Override equals() in Java In Java, Overriding is when the child class or the subclass has the same execution of method as declared in the parent class . The equals() method compares two strings. If the data of one string object is the same as the other, it returns True value otherwise False.19 Haz 2021