how to compare 2 objects java code example Example: how to compare objects in java this.equals(other)