Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!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: super References: <3e87dcf3-6842-41bf-8eb8-0c4181a178a9@k1g2000vbz.googlegroups.com> <797b5b56-9855-4ff1-a1e9-1eef2dcef7a8@d12g2000vba.googlegroups.com> Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: Date: 18 Sep 2011 19:48:24 GMT Lines: 23 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1316375304 tunews.univie.ac.at 11354 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8136 giuseppe.on.usenet wrote: > On 18 Set, 20:26, Andreas Leitgeb > wrote: >> I think the misunderstanding is far more basic. >> To giuseppe: >> In dir2.GrandChild's main, just remove the line, where you instantiate >> Child, and leave the rest exactly as is.  Recompile & run it.  You'll >> see that instantiating class Child (or not doing it) doesn't change >> anything. What does this tell you? > > I am not the author :) I found that code in a certification study > guide (the original question was: What will the output be?). That doesn't really matter. Obviously you didn't "guess" (or know) the answer (or you wouldn't have asked here). If you are still surprised by "super.var" and "var" being the same value, then I advise you to still make the experiments I suggested. > Maybe > they instantiated the Child object just to try to confuse the reader. Not primarily to confuse him, but rather to test his confusability ;-)