91.
What is false about constructor?

93.
What will be the output of the following Java program?
class equality 
{
    int x;
    int y;
    boolean isequal()
    {
        return(x == y);  
    } 
}    
class Output 
{
    public static void main(String args[])
    {
        equality obj = new equality();
        obj.x = 5;
        obj.y = 5;
        System.out.println(obj.isequal());
    } 
}

94.
What will be the output of the following Java program?
class box 
{
    int width;
    int height;
    int length;
} 
class mainclass 
{
    public static void main(String args[]) 
    {        
        box obj1 = new box();
        box obj2 = new box();
        obj1.height = 1;
        obj1.length = 2;
        obj1.width = 1;
        obj2 = obj1;
        System.out.println(obj2.height);
    } 
}

97.
What will be the output of the following Java code?
class A
{
     A()throws IOException
     {
 
     } 
 
}
class B extends A
{
     B()
     {
 
     }
     public static void main(String[]args)
     {
 
     }
}

Read More Section(Constructors and Methods)

Each Section contains maximum 100 MCQs question on Constructors and Methods. To get more questions visit other sections.