This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Note: There is a bug in line 10 of your code. The method should have been named hashCode(), not hashcode(). Because it has the wrong name, it's not overriding hashCode() of class Object, and it will not be called.
You should use the @Override annotation to catch such mistakes:
And there is another bug, in line 15. You are comparing strings with == there. That does not work; use .equals() instead to compare strings.