Equals() and Hashcode() in Java. The equals() and hashcode() are the two important methods provided by the Object class for comparing objects . Since the Object class is the parent class for all Java objects, hence all objects inherit the default implementation of these two methods.