Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: It doesn't like 'super' where ever I put it. Date: Mon, 11 Jun 2012 22:50:09 +0200 Lines: 40 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net EzNgejhsvIMr4AutnwMgSwctduSFv1SgJ1gKGlMrugr742VGOpcQ+RJ6elqwAMH+8= Cancel-Lock: sha1:x/E5nw555sCGmi86+cQcncR0IXA= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:15207 On 10.06.2012 20:51, Stefan Ram wrote: > Robert Klemme writes: >> On 10.06.2012 19:10, Stefan Ram wrote: >>> v_borchert@despammed.com (Volker Borchert) writes: >>>> This is not a constructor, but a method named like one. >>> I'm not sure, whether this explains the error message given: >>> |Constructor must call super() or this() before >>> , because when there is no explicit constructor, the compiler >>> will generate one, and this generated constructor /should/ >>> call =BBsuper() or this() before=AB. >> The compiler will only generate a default constructor (i.e. without >> arguments) if there is no other constructor. > > There was no (other) constructor in the code of the OP, > so a default constructor must have been generated, which > will include a correct call of =BBsuper()=AB. > Only that this won't be done for non constructors which is what the=20 method was, as has been pointed out public void CalcFrame1() { ... } Note that super(...) is always a constructor call because method calls=20 read super.method(...). Granted, the error message is probably not the most telling. Eclipse say= s Constructor call must be the first statement in a constructor=20 CalcFrame1.java /c.l.j.p/src line 8 Java Problem Which is certainly clearer. Cheers robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/