Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. What is the output of running class C? class A public A0 f System.out.println

ID: 3714196 • Letter: 6

Question

6. What is the output of running class C? class A public A0 f System.out.println( "The default constructor of A is invoked"); class B extends A { public B0i System.outprintln( "The default constructor of B is invoked"); public class C.A public static void main(Stringll args) { B b- new B0; a. Nothing displayed b. "The default constructor of B is invoked" c. "The default constructor of A is invokedThe default constructor of B is invoked" d. "The default constructor of B is invoked"The default constructor of A is invoked" e. "The default constructor of A is invoked"

Explanation / Answer

We will get
The default constructor of A is invoked
The default constructor of B is invoked

Option c.

Because, when constructor B is invoked, it will make an implicit call to super() at the very beginning