This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
There can be many objects which are not equal() but which return the same hashcode() but you can never have two objects which are equal() with different hashcode()
For example consider a name object, where two names are equal() if they have the same first name and last name. The hashcode() could be simply to take the first letter of the last name. So you are filing all the names alphabetically into 26 'buckets'.
Ram Chhabra goes into the 'C' bucket and so does Dave Charles. They both have the same hashcode() but they are not equal().
In addition to this, always override hashCode() when you override equals() in your own classes. I will show you with a piece of code what happens when you don't. It will prevent your class from working correctly when you use a hash-based collection, such as a HashMap.
Beware: the instanceof operator can cause subtle and nasty errors when you inherit from that Person class. Google for Angelika Langer java equals or go through Joshua Bloch's book; it used to be possible to find a sample chapter including equals() on the net somewhere.