Printing an Object in Java

When you use System.out.println( ) by passing an object as an argument, the JRE invokes its toString( ) method by default. If you haven't overridden this method, then you end up with very vague output. For example: