Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> Hi! > The code for equals() in the article ensures that the Object passed as an argument is of the same type as itself by trying a typecast; failure results in a ClassCastException which is caught: > public boolean equals(Object o) { > if (o == null) { > Worker w; > > public boolean equals(Object obj) > Is this OK? Or are there any hidden glitches in this that aren't apparent to me? > Thanks,
Replies:
|
Sponsored Links
|