In Java, java.lang.Object is at the top of the class hierarchy. The equals() method is declared in java.lang.Object as public boolean equals(Object obj). In your class, declare this method and write your code within this method. That basically constitutes overriding the equals() method.
Hope this helps!
Joined: Feb 23, 2005
Thanks for your reply.
subject: how to override equals() method in java??