81.
What will be the output of the following Java program?
class string_class 
{
    public static void main(String args[])
    {
        String obj = "I LIKE JAVA";   
        System.out.println(obj.charAt(3));
    } 
}

83.
What will be the output of the following Java program?
class access
{
    public int x;
static int y;
    void cal(int a, int b)
    {
        x +=  a ;
        y +=  b;
    }        
}    
class static_specifier 
{
    public static void main(String args[])
    {
        access obj1 = new access();
        access obj2 = new access();   
        obj1.x = 0;
        obj1.y = 0;
        obj1.cal(1, 2);
        obj2.x = 0;
        obj2.cal(2, 3);
        System.out.println(obj1.x + " " + obj2.y);     
    }
}

84.
What will be the output of the following Java snippet, if compiled and executed with command line argument "java abc 1 2 3"?
public class abc
{
   static public void main(String [] xyz)
   {
       for(int n=1;n<xyz.length; n++)
       {
          System.out.println(xyz[n]+"");
       }
   }
}

86.
What will be the output of the following Java program?
class string_class 
{
    public static void main(String args[])
    {
        String obj = "hello";
        String obj1 = "world";   
        String obj2 = obj;
        obj2 = " world";
        System.out.println(obj + " " + obj2);
    }
}

87.
What will be the output of the following Java program?
class area 
{
    int width;
    int length;
    int height;
    area() 
    {
    width = 5;
    length = 6;
    height = 1;
    }
    void volume() 
    {
         volume = width * height * length;
    } 
}    
class cons_method 
{
    public static void main(String args[]) 
    {
        area obj = new area();
        obj.volume();
        System.out.println(obj.volume);
    } 
}

90.
What will be the output of the following Java program?
class string_class 
{
    public static void main(String args[])
    {
        String obj = "hello";
        String obj1 = "world";   
        String obj2 = "hello";
        System.out.println(obj.equals(obj1) + " " + obj.equals(obj2));
    }
}

Read More Section(Miscellaneous in Java)

Each Section contains maximum 100 MCQs question on Miscellaneous in Java. To get more questions visit other sections.