Assume you have defined a Dog class that has a String name member and corresponding mutator and accessor. Also, assume you did not define a toString() method for your Dog class.
Two Dog references, myDog and yourDog, are declared, and one of them, yourDog, is used to instantiate a Dog object (code not shown). Next, the following statement is executed:
myDog = yourDog;
so that both references manage (i.e., point to) the same Dog object.
If we change myDog's name, by a mutator call:
myDog.setName("LiliKoi");
this will (choose all true statements):
A. cause both
System.out.println( myDog );
and
System.out.println( yourDog );
to display LiliKoi.
B. cause only
System.out.println( yourDog.getName() );
to display LiliKoi, but not
System.out.println( myDog.getName() );
C. cause only
System.out.println( myDog.getName() );
to display LiliKoi, but not
System.out.println( yourDog.getName() );
D. cause both
System.out.println( myDog.getName() );
and
System.out.println( yourDog.getName() );
to display LiliKoi.