how to check wether two object references are equal or not in java code example Example: how to compare objects in java this.equals(other)