Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.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: Sun, 10 Jun 2012 20:39:42 +0200 Lines: 29 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 49yLM6V8F+uMYxuQG5BfwA5oObsTEbuADg7cF2gW2zAwPjwzfNEYsGsBbqW4ZHNgc= Cancel-Lock: sha1:f0r6GZvU+D0bDZyNN8q79E0wq+I= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120604 Thunderbird/13.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:15183 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=20 arguments) if there is no other constructor. That generated default=20 constructor cannot invoke any other superclass constructor than the=20 default constructor (where should it take arguments from?). I'm too=20 lazy to lookup in JLS right now (Ireland - Croatia starts in a few=20 minutes) but I am sure you'll find it explained in the JLS. Kind regards robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/