0
Why this code when write System.out.println(y);give this output and what is mean but when writ system.out.println(y.one)
give the right code https://code.sololearn.com/cwQIjtJdtEA8/?ref=app
2 Answers
0
the first is printing object reference or calling your toString method that you have over ridden in your class.
the second is printing a field of y.
which are you after?
0
tostring method ?lcan not understand what you mean can explain more