Which toString() method does System.out.println() call?
843789Aug 5 2010 — edited Aug 17 2010Which toString() method does System.out.println() call? I know that if I did something like System.out.println( new myClass() ) that the toString being called would be that of the myClass class.
My initial thought about this was that System.out.println() is the equivalent of System.out.println( new Object() ) but I remember trying that in a test program and it gave me a myClass@some_hash_code type of message when adding the new Object() part within the System.out.println().
Could someone please tell me which toString the System.out.println() statement calls? Also, it would be great if an elaboration follows :).
Any input woudl be greatly appreciated!
Thanks in advance!