Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.straub-nv.de!texta.sil.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: 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 08:44:38 GMT Lines: 20 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1302165878 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:2916 Lew wrote: > Andreas Leitgeb wrote: >>> Is there any *good* use of having the constructor call a method that >>> actually *can* be overridden in a subclass? I mean, are there >>> (non-anti)patterns of explicitly allowing subclasses to hook into >>> base-class's construction? > > import org.apache.log4j.Logger; > import static org.apache.log4j.getLogger; > public class Foo > { > private final Logger logger = getLogger( getClass() ); > // ... > } I thought, I made it clear, that calling static methods was not relevant to my question. So, kind of thanks for pointing out that I should have written non-static in the very line of the question, rather than consider that clear from the other (snipped by you) paragraphs of my post...