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.printInobjname 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
