I think you haven't properly worked with the objects. When you create a
instance of a class and print it it gives the address of the object, and if you
want to see the hash code then you have to use the object.hashCode() method..
you can try this out
create an object of a class simply print it and print the object.hashCode()
value both will be different...