how to compare two instances of the same objects in java code example Example: how to compare objects in java this.equals(other)