When you use primitive data types such as int,float, double etc., in your System.out.println() statement the value of the data is printed. But when you use an object reference in the System.out.println() statement the object toString() method is called and output of the toString() method(String) is printed in the console.
[ February 19, 2008: Message edited by: Arivazhagan Arutchelvam ]