How do I override the equals method in the object class?
i.e I have
class Person{
//need to override here
public boolean equals (Object obj){
}
One more point may be good to know that after you override equals() method (and also hashcode()) method you can to compare two objects of same class like follows:
Person p1 = new Person();
Person p2 = new Person();
....
if ( p1.equals( p2 ) )
{
// --- Two Persons are equal, w.r.t the fields you specified in equals method ---
}