41.
What will be the output of the following Java program?
package pkg;
class output 
{
    public static void main(String args[])
    { 
        StringBuffer s1 = new StringBuffer("Hello");
        s1.setCharAt(1, x);
        System.out.println(s1);
    }
}

42.
Which of these exceptions handles the situations when an illegal argument is used to invoke a method?

43.
What will be the output of the following Java program?
class Output 
{
     public static void main(String args[]) 
    {
        double x = 2.0;  
        double y = 3.0;
        double z = Math.pow( x, y );
        System.out.print(z);
    }
}

45.
What will happen if we provide concrete implementation of method in interface?

47.
What will be the output of the following Java program?
import java.lang.System;
class Output 
{
    public static void main(String args[])
    {
        byte a[] = { 65, 66, 67, 68, 69, 70 };
        byte b[] = { 71, 72, 73, 74, 75, 76 };  
        System.arraycopy(a, 0, b, 0, a.length);
        System.out.print(new String(a) + " " + new String(b));
    }
}

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.