62.
What will be the output of the following Java program?
class Output 
{
     public static void main(String args[])
     {
         char a[] = {'a', '5', 'A', ' '};   
         System.out.print(Character.isDigit(a[0])+ " ");
         System.out.print(Character.isWhitespace(a[3])+ " ");
         System.out.print(Character.isUpperCase(a[2]));
    }
}

66.
What will be the output of the following Java program?
public class BoxDemo 
{
    public static <U> void addBox(U u, 
    java.util.List<Box<U>> boxes) 
    {
       Box<U> box = new Box<>();
       box.set(u);
       boxes.add(box);
    }
    public static <U> void outputBoxes(java.util.List<Box<U>> boxes)
    {
        int counter = 0;
        for (Box<U> box: boxes) 
        {
            U boxContents = box.get();
            System.out.println("Box #" + counter + " contains [" + boxContents.toString() + "]");
            counter++;
        }
    }        
    public static void main(String[] args)
    {
        java.util.ArrayList<Box<Integer>> listOfIntegerBoxes = new java.util.ArrayList<>();
        BoxDemo.<Integer>addBox(Integer.valueOf(10), listOfIntegerBoxes);
        BoxDemo.outputBoxes(listOfIntegerBoxes);
    }
}

67.
What will be the output of the following Java program?
class X
{
    int a;
    double b;
}
class Y extends X 
{
int c;
}
class Output 
{
    public static void main(String args[]) 
    {
        X a = new X();
        Y b = new Y();
        Class obj;
        obj = b.getClass();
        System.out.print(obj.getSuperclass());
    }
}

70.
What will be the output of the following Java code snippet?
int a = random.nextInt(15) + 1;

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.