This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
automatic casting
- From: kartick Vaddadi <kartick_vaddadi at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 31 Aug 2004 05:49:04 -0700 (PDT)
- Subject: automatic casting
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