Article View: borland.public.jbuilder.java.language
Article #8428Re: Is "return super;" a valid statement
From: Ralph Quapp
Date: Mon, 19 Mar 2001 21:57
Date: Mon, 19 Mar 2001 21:57
36 lines
2444 bytes
2444 bytes
Ok, the example was a bit to simple or I did not explain the intended use well enough: In fact I want to return a reference to an instance of class A, only. Class B was only intended to prepare class A for a specific usage, and it is not intended to be used any further. I therefore wanted to 'remove' the B part of the instance. But probably - even when it would be a valid construct - it would not work as it still will behave polymorphic (tested with JBuilder). Thanks for all the answers. The question is now, should the compiler issue some warning or not. I am wondering what kind of bytecode JBuilder generates. How can I see that? Regards Ralph "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.151df2148cd2b2f398a08a@forums.borland.com... > One further note: If you are trying to call the superclass version > of your doSomething() method, the way to do that would be: > > return super.doSomething(); > > But again, as in the previous example, this would have the same effect > as removing the declaration of doSomething() from the subclass > altogether, since without it the superclass method would be called. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3ab6816f_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!63.197.90.11References:
<3ab26402$1_1@dnews> <MPG.151cdabe37c2b74f98a084@forums.borland.com> <MPG.151df2148cd2b2f398a08a@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a2b6df84216d25a2 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-23 03:56:06 PST From: "Ralph Quapp" <-> Newsgroups: borland.public.jbuilder.java.language References: <3ab26402$1_1@dnews> <MPG.151cdabe37c2b74f98a084@forums.borland.com> <MPG.151df2148cd2b2f398a08a@forums.borland.com> Subject: Re: Is "return super;" a valid statement Date: Mon, 19 Mar 2001 13:57:56 -0800 Lines: 38 Organization: Alcatel Carrier Internetworking Division X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: 63.197.90.11 Message-ID: <3ab6816f_1@dnews> X-Trace: 19 Mar 2001 14:00:15 -0800, 63.197.90.11 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!63.197.90.11