MCQs
Total Questions : 31
| Page 3 of 4 pages
Answer: Option D. -> Compilation Error
Answer: Option B. -> Compilation fails due to an error on line 1
Answer: Option B. -> 2
Answer: Option E. -> 1 and 3
Answer: Option B. -> Compile fail due to error on line no 9
Answer: Option A. -> abc
Answer: Option B. -> int
Question 28. What 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);
}
}
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);
}
}
Answer: Option A. -> A B 8
Answer: Option A. -> A a = new B();
Answer: Option B. -> void examveda() throws IOException{}