devxlogo

February 1, 2006

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