Question

49 50 Given two reference variables t1 and t2 if t1 t2 is true, t1.equals(t2) must be A. true C B. false If an object is an instance of class A, and class A is a subclass of class B, then the object is also an instance of class B. C True C False Analyze the following code: public class Test public static void main(StrngO args) Object al new A Object a2-new Object 0; System out. println(al); System out. pri tin (a class A int public string tostrngo retum As x is x; A. When executing System.out.println(a1), l the tostringo method in the object class is invoked. B. When executing System.out.println(a2), the tostringo method in the object class is invoked C. When executing System.out.println(a1), r the tostringo method in the A class is invoked. D. The program cannot be compiled, because System.out.println(a1) is wrong and it should be replaced by System out.println(a1.toString0);

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
What is the output of the following code? public class Test { pub be static void...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT