Question: When you put an object's reference variable in a place where a String is expected ( like System.out.printIn ( objname ) ) , what will

When you put an object's reference variable in a place where a String is
expected (like System.out.printIn(objname)), what will happen?
The first String field inside the object will be used as a string
Compile error
The object reference's name will be used as a string
The object's class' toString() method will be called
When you put an object's reference variable in a

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 Programming Questions!