11.
Which of the following statements are incorrect?

13.
What is true about protected constructor?

14.
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 obj = new box();
         System.out.println(obj);
     } 
 }

15.
In the following Java code, which call to sum() method is appropriate?
class Output 
{
 
        public static int sum(int ...x)
        {
             return; 
        }
        static void main(String args[]) 
        {    
             sum(10);
             sum(10,20);
             sum(10,20,30);
             sum(10,20,30,40);
        } 
}

16.
How can we identify whether a compilation unit is class or interface from a .class file?

17.
What will be the output of the following Java program?
class box 
{
    int width;
    int height;
    int length;
    int volume;
    void volume(int height, int length, int width) 
    {
         volume = width*height*length;
    } 
}    
class Prameterized_method
{
    public static void main(String args[])
    {
        box obj = new box();
        obj.height = 1;
        obj.length = 5;
        obj.width = 5;
        obj.volume(3,2,1);
        System.out.println(obj.volume);        
    } 
 }

18.
Which of these will happen if recursive method does not have a base case?

Read More Section(Constructors and Methods)

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