84.
What will be the output of the following Java program?
import java.util.*;
public class genericstack  
{
    Stack  stk = new Stack ();
public void push(E obj)
    {
        stk.push(obj);
}
public E pop()
    {
        E obj = stk.pop();
  return obj;
}
}
class Output
{
    public static void main(String args[])
    {
        genericstack  gs = new genericstack();
        gs.push("Hello");
        System.out.print(gs.pop() + " ");
        genericstack  gs = new genericstack();
        gs.push(36);
        System.out.println(gs.pop());
    }
}

85.
What will be the output of the following Java code?
class Output 
{
    public static void main(String args[])
    {
        Double i = new Double(257.5);  
        boolean x = i.isNaN();
        System.out.print(x);
    }
}

86.
What will be the output of the following Java code?
class isNaN_output 
{
    public static void main(String args[]) 
    {
        Double d = new Double(1 / 0.);  
        boolean x = d.isNaN();
        System.out.print(x);
    }
}

88.
What will be the output of the following Java program?
    package pkg;
    class display 
    {
        int x;
        void show() 
        {
            if (x > 1)
                System.out.print(x + " ");
        }
    }
    class packages 
    {
        public static void main(String args[]) 
        {
            display[] arr=new display[3];
            for(int i=0;i<3;i++)
                arr[i]=new display();
            arr[0].x = 0;      
            arr[1].x = 1;
            arr[2].x = 2;
            for (int i = 0; i < 3; ++i)
                arr[i].show();
         }
    }

Note : packages.class file is in directory pkg;

89.
What will be the output of the following Java program?
class Output
{
    public static void main(String args[])
    {
        Double i = new Double(257.5);  
        Double x = i.MIN_VALUE;
        System.out.print(x);
    }
}

Read More Section(Interfaces and Abstract Classes)

Each Section contains maximum 100 MCQs question on Interfaces and Abstract Classes. To get more questions visit other sections.