Solved

What Is the Output of Running Class C? Class a

Question 15

Multiple Choice

What is the output of running class C? class A {
Public A() {
System.out.println(
"The default constructor of A is invoked") ;
}
}
Class B extends A {
Public B(String s) {
System.out.println(s) ;
}
}
Public class C {
Public static void main(String[] args) {
B b = new B("The constructor of B is invoked") ;
}
}


A) none
B) "The constructor of B is invoked"
C) "The default constructor of A is invoked" "The constructor of B is invoked"
D) "The default constructor of A is invoked"

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions