Java Reference
In-Depth Information
Define the equals method to test whether two objects have equal state.
This is different from the test with the == operator, which tests whether the two
references are to the same object:
if (coin1 == coin2) . . .
// Objects are the sameȌsee Figure 10
Figure 9
Two References to Equal Objects
468
469
Figure 10
Two References to the Same Object
Search WWH ::




Custom Search