From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10266 invoked by alias); 31 Aug 2004 12:49:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10225 invoked from network); 31 Aug 2004 12:49:05 -0000 Received: from unknown (HELO web20424.mail.yahoo.com) (66.163.170.247) by sourceware.org with SMTP; 31 Aug 2004 12:49:05 -0000 Message-ID: <20040831124904.71199.qmail@web20424.mail.yahoo.com> Received: from [203.200.24.12] by web20424.mail.yahoo.com via HTTP; Tue, 31 Aug 2004 05:49:04 PDT Date: Tue, 31 Aug 2004 13:01:00 -0000 From: kartick Vaddadi Subject: automatic casting To: gcc@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-08/txt/msg01612.txt.bz2 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