Implementing .equals

Brad Mongar Java, Opinion 6 Comments

Scenario You are working on a project and you have two objects. You want to know if, according to the business, they are the same item. So you call .equals. It returns false because they aren’t the same object in memory. You then override the .equals method to compare the attributes that make the items equal to the business. This …