Java-Overriding equals Method

Overriding equals Method The equals( ) method compares two object reference, to see whether they refer to the same object. Program : Without Overriding equals   The following example overrides equals() method . Program : With Overriding equals Program Source : Without Overriding equals class Book { String name; Book(String na) { name = na; } } public class … Read more…