What is difference between equals() and == operator
Both are same ,Object(C) has equals() method that has logic for == operator ->Here it will compare two objects references, are they pointing to same object or different object (NOT HASHCODE). ->This method is non-static, non-final, non-private. So, we can override in our class such that it compares data not object references. ->operator == will not compare hashCodes they will compare object references. ->Even two objects can have same hashCode which might be refering to different obejcts.
No Comments Yet!!