+ 1
Why output is "x"?
Hello, guys! This is code from challenge. So, who can explain me, why in output "x"? What a java magic?:) I mean, we don't call method toString(), but just make new object? https://code.sololearn.com/c66M60VQ4wCu/?ref=app
3 Answers
+ 13
https://stackoverflow.com/questions/20735132/what-happens-when-printing-an-object-in-java
+ 10
When printing out an object, the compiler calls the toString() method
0
Really? It's mean that "toString" default getter, hm.
thank you!