View Single Post
  #2 (permalink)  
Old 09-13-2008, 02:47 AM
Norm's Avatar
Norm Norm is offline
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
Norm is on a distinguished road
Quote:
i get like an address like this "student@12dacd1".
What you are seeing is the default value returned by the Object class's toString() method. You must be trying to use println on a class object which you have not overriden the toString method.
Add a toString() method to your class to return what you want to see. Read the API doc for the Object class's toString method so you code it correctly when you override it. If you are using Java 1.6 (maybe also 1.5) add @Override before the definition of the method to have the compiler check that you have correctly coded the override.
Reply With Quote