09-26-2007, 06:19 PM
instanceof is when you dont know the concrete type of the object and you are using some abstract parent type to point to the object. if you are using a more concrete type, then you made a mistake. "you would never be doing this anyway" is exactly why it throws an error.
it does seem a little strange especially if coming from c++, but java babysits you more, which IMO is a good thing. no type saftey is a huge pita
it does seem a little strange especially if coming from c++, but java babysits you more, which IMO is a good thing. no type saftey is a huge pita