Question: Given two reference variables t1 and t2, if t1 = t2 is true, t1 .equals(t2) must be___. A. true B. false If an object is

 Given two reference variables t1 and t2, if t1 = t2

Given two reference variables t1 and t2, if t1 = t2 is true, t1 .equals(t2) must be___. A. true 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. True False Analyze the following code: public class Test {public static void main(String|] args) {Object a 1 = new A(); Object a2 = new Object(); System out. println (a 1); System out. println (a 2);} class A {int x; public String toString() {return "A's x is " + x;}} A.0 When executing System.out.println(a1) the toString() method in the Object class is invoked. B. When executing System.out.println(a2); the toString() method in the Object class is invoked. C. When executing System.out.println(a1); the toString() 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 .toString())

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!