MCQ Practice Single Best Answer Topic: Inheritance in Java MCQ

Q What is the output of the following program code?
abstract class C1{
	public C1(){ 
		System.out.print(1); 
	} 
} 
class C2 extends C1{ 
	public C2(){ 
		System.out.print(2); 
	} 
} 
class C3 extends C2{ 
	public C3(){ 
		System.out.println(3); 
	} 
} 
public class Test{ 
	public static void main(String[] a){ 
		new C3(); 
	} 
}

Question ID
#2254
Subchapter
Inheritance in Java MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 12
  • B 23
  • C 123
  • D 321
Correct Answer: C

Explanation

123

Share This Question

Share this MCQ with your friends or study group.