72.
What will be the output of the following Java program?
class dynamic_initialization 
{
    public static void main(String args[]) 
    {
        double a, b;
        a = 3.0;
        b = 4.0;
  double c = Math.sqrt(a * a + b * b);
  System.out.println(c);
    } 
}

76.
What will be the output of the following Java program, if we run as "java main_arguments 1 2 3"?
class main_arguments 
{
    public static void main(String [] args) 
    {
        String [][] argument = new String[2][2];
        int x;
        argument[0] = args;
        x = argument[0].length;
        for (int y = 0; y < x; y++) 
            System.out.print(" " + argument[0][y]);              
    }
}

78.
What will be the output of the following Java code?
class A 
{
    final public int calculate(int a, int b) { return 1; } 
} 
class B extends A 
{ 
    public int calculate(int a, int b) { return 2; } 
} 
 public class output 
 {
    public static void main(String args[]) 
    { 
        B object = new B(); 
        System.out.print("b is " + b.calculate(0, 1));  
    } 
}

79.
What will be the output of the following Java code snippet?
 enum Levels 
{
    private TOP,
 
    public MEDIUM,
 
    protected BOTTOM;
}

Read More Section(Data Types and Variables)

Each Section contains maximum 100 MCQs question on Data Types and Variables. To get more questions visit other sections.