Generally speaking, equals() and "==" operator are used to compare whether two objects are equal, but there are many differences between the two:
The main difference is that .equals() is a method, == is an operator. Use == to compare references, referring to whether they point to the same memory address. Use .equals() to compare the content of objects, comparing values. If .equals is not overridden, it will default to calling the nearest superclass to override this method.