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.