if you don't override equals(), you inherit the one from the Object class. This does nothing more than compare if the REFERENCES are equal. You need to override the equals method so that it makes sense for your object. For example, two object of my House class may be equal if the houses are worth the same amount. Or it may make more sense for me to define it if they have the same number of bedrooms. Or if they have the same square footage.
Since you are defining the class, YOU have to decide what makes two instances 'equal', and tell the JVM how to figure that out.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
You will find lots about it if you search this forum; questions about equals are asked about once a week, and you will find something useful. The reason for overriding hashCode too is that there are members of the collections Framework which depend on the hash code for sorting elements.