I am debugging my java program, and I have some instance "instance1" of class called "SomeClass". When I evaluate the variable "instance1", it says result = {SomeClass@816}.
What does "@816" actually mean?
I know it is not for sure the hashCode(), is it the instance memory address? If so, how can I "see" the instance address in code? Which method to call on the object itself?
Note: I am using IntelliJ Idea
public class SomeClass {
private String name;
private int id;
@Override
public String toString() {
return this.name + this.id;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
String objName = ((SomeClass) o).name;
return this.name.equals(objName);
}
@Override
public int hashCode() {
return this.name.hashCode();
}