Java Objects

There are several characteristics and important points about an object in Java that you should note, some of them are as follows:

  • If two objects return true via a call to the equals() method then they must have the same hashCode()
  • following on this means if you override equals() then you must also override hashCode()
  • two "equals" objects must have the same hashcode, but if two objects have the same hashcode they can be different