MCQ
Single Best Answer
Not Set
QWhat is the output for the below code ?
class A{
public A(){
System.out.println("A");
}
public A(int i){
this();
System.out.println(i);
}
}
class B extends A{
public B(){
System.out.println("B");
}
public B(int i){
this();
System.out.println(i+3);
}
}
public class Test{
public static void main (String[] args){
new B(5);
}
}
ID: #2193
Java Constructor and Methods
621 views
Question Info
#2193Q ID
Not SetDifficulty
Java Constructor and MethodsTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
A B 8
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic