Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!newsfeed.straub-nv.de!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: calling own methods from constructor References: <41ac2ca5-83e8-4b80-92af-9704b373ec37@q36g2000yqn.googlegroups.com> <304a8aef-3852-4817-b5a7-5468fcdf11a1@x18g2000yqe.googlegroups.com> <0b2e25ae-35d6-45b6-8b8f-ac24d90f59ec@v8g2000yqb.googlegroups.com> Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 07 Apr 2011 22:15:03 GMT Lines: 31 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1302214503 tunews.univie.ac.at 60386 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2952 Lew wrote: > Andreas Leitgeb wrote: >> Actually, I tried to explain, why I was rambling about static methods >> in response to your example. > No, you tried to be sarcastic and to make my answer seem wrong even > though it was precisely what you asked for. Without the explanation that you only gave later, it *was* wrong. I asked for an example of calling an overridable method from the constructor, and you gave an example where both a static and a final method got called. That that final method *could* have been instead implemented as a bunch of virtual methods, definitely wasn't obvious at that point. If you provide cryptic answers, just don't be surprised about them being misunderstood and therefore taken as non-answers. Until you explain them, that is. > You asked if there were specific cases where it was good to use an > overridable (you never said 'final' [...]) But 'final' surely implies non-overridability, doesn't it? Therefore, overridability of a method implies its non-'final'ity. > It's just that there are occasionally (!) times when an overridable > method (though not necessarily a 'final' one, since even 'final' > methods can call overridable methods in turn) can be usefully called > inside a constructor (or initializer, equivalently). That was the > parameter of the original question, and that has been demonstrated. > Twice over, now. 'kay