Article View: borland.public.jbuilder.java.language
Article #18202Re: super() causing grief
From: Acid Steve
Date: Tue, 28 Jul 1998 00:00
Date: Tue, 28 Jul 1998 00:00
45 lines
2296 bytes
2296 bytes
Hi, Peter,
All i could say is the following: super() method u can use _ONLY_ in the
first line of method u 're writing. It's super.SomeMethod() that u can
use wherever u want. Actually, if u place super() as the first line, u
shouldn't get any error. But the thing u can try is to put not super();
, but super.MySubClass() since the expressions mean absolutely the same
thing: construct the class through theirs parent constructor.
Think, it might help, but think as well there might be some other
mistakes or slips of the fingers, such as enclosed parentheses, etc.
Acid Steve
Peter Jacobs wrote:
>
> According to all the documentation I can find, the following code should
> work:
>
> public MySubClass(BufferedReader file, Session session) throws
> Exception {
>
> // MySubClass specific code cut for clarity
>
> super(file, session);
> }
>
> On first compilation JBuilder complained that the super class was
> lacking a default constructor; which is fair enough as that is the
> implicit first line of any sub-class constructor. But it will not
> accept "super(file, session)" giving "Error (37): method required but
> value found" regardless of where in the code I place that line. The
> matching constructor does exist and does work.
>
> As an experiment I placed "super()" as the first line of the code - and
> got the same error for that line too: deep weirdness.
>
> Am I missing something or is this a bug???
>
> --
> Peter Jacobs
> Principal Software Engineer
> Computerised Document Control Ltd
> Email : peterj@docctrl.com
> WWW : http://www.docctrl.com
Technical Details
Message-ID:
<35BD0337.707B7870@hempseed.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35BCDD55.AA65A23E@docctrl.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,47975f63c94188a0 X-Google-Attributes: gidf74b3,public From: Acid Steve <acidsteve@hempseed.com> Subject: Re: super() causing grief Date: 1998/07/28 Message-ID: <35BD0337.707B7870@hempseed.com> X-Deja-AN: 375462612 Content-Transfer-Encoding: 7bit References: <35BCDD55.AA65A23E@docctrl.com> X-Accept-Language: ru Content-Type: text/plain; charset=koi8-r Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language