Solved

What Is the Output of Running Class C? Class a

Question 4

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents