Solved

What Is the Output of Running the Class C

Question 8

Multiple Choice

What is the output of running the class C. public class C {
Public static void main(String[] args) {
Object[] o = {new A() , new B() };
System.out.print(o[0]) ;
System.out.print(o[1]) ;
}
}
Class A extends B {
Public String toString() {
Return "A";
}
}
Class B {
Public String toString() {
Return "B";
}
}


A) AB
B) BA
C) AA
D) BB
E) None of above

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