automatic casting

kartick Vaddadi kartick_vaddadi@yahoo.com
Tue Aug 31 13:01:00 GMT 2004


in code such as this:

if (o instanceof Dog)
    {
    Dog d = (Dog)o;
    d.bark();
    . . .
    }

why not eliminate the requirement to cast, since the
instanceof ensures that the object is of the right
type;i.e., u should be able to write:

if(o instanceof Dog)
    {
    o.bark();
    . . .
    }

what do u think?
-kartick


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the Gcc mailing list