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