Say I have my own class
public class MyObj { }
It has some attributes and methods. It does NOT implement equals, does NOT implement hashCode.
Once we call equals and hashCode, what are the default implementations? From class Object? So what is this? How will equal default values be used? How will hashCode work by default and what will be returned? == will just check to see if they reference the same object, so it's easy, but what about the equals () and hashCode () methods?
java equality object equals hashcode
alexeypro Nov 14 '10 at 18:40 2010-11-14 18:40
source share