Answer the question
In order to leave comments, you need to log in
What is the point of checking getClass() != o.getClass()?
Good day.
There is an example implementation of the equals() method:
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Vertex vertex = (Vertex) o;
return Objects.equals(getId(), vertex.getId()) &&
getState() == vertex.getState() &&
Objects.equals(getVertices(), vertex.getVertices());
}
getClass() != o.getClass()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question