I am not an expert on hashcode but basically the equals method is the java way of testing objects for equality.
The default equality implementation is done by testing equality of references.
A Class may override the equals method to provide the tests based on the content of the object.
Ex:- java.lang.String
When you are creating new classes you should also implement your own equals method if nessasary but in most of the cases the reference based equality is sufficient.
> can anyone explain me the use of equals and hascode ?
Instead of us repeating what has been stated in the forum previously, why don't you try searching the forum first before posting a question?
Its really not that hard!!! I just used "equals and hashcode", taken directly from your subject and found severaly postings on the subject.