I'm learning about overriding equals() and hashCode().
In one of the articles there is this Car class and in it the hashCode() method is being overridden:
@Override public int hashCode() { int result = model == null ? 0 : model.hashCode(); result = result + manufactureYear; result = result + dollarPrice; return result; }
My question is: what happens when the model.hashCode() is called?
It seems to me that it calls the same hashCode() to check if model.hashCode() is equal - so it's recursive.
But apparently it works. So what happens there.