You are on page 1of 1

public static void main(String[] args)

{
Constructor3 con = new Constructor3();
}
}
A) Birds=0
B) Birds=10
C) Birds=20
D) Compiler error
Ans:C
29-In Java, you can pass __ variables from one constructor to another overloaded constructor.
A) local variables
B) static variables
C) non-static variables
D) local and static variable
30- Choose the correct way of calling the second constructor from the first constructor in the
below code options.
A)
Constructor5()
{
int a=30;
this('A');
}
Constructor5(char c)
{
//
}
B)
Constructor5()
{
int a=30;
this('A');
System.out.println("Success");
}
Constructor5(char c)
{
//
}
C)
Constructor5()
{
this('A');
System.out.println("Success");
}
Constructor5(char c)

You might also like