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:
Dave, > > I think the class of both objects must be the same, which > Exactly. You need to check if the class names of both classes are the same. The class name is specific to the actual object, irrespective of subtyping. Any type of casting (whether done with explicit casting or testing with instanceof) allows subtypes to get "through the screen" if you will. For instance, the following will get through: We can't just check the class names, though, because a VM bv
Replies: |
Sponsored Links
|