Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail From: "Leif Roar Moldskred" Subject: Re: Need help with a program. Message-ID: <50327C3C.57164.calajapr@time.synchro.net> X-Comment-To: yanamandra Newsgroups: comp.lang.java.programmer In-Reply-To: <50327C3C.57163.calajapr@time.synchro.net> References: <50327C3C.57163.calajapr@time.synchro.net> X-FTN-AREA: COMP.LANG.JAVA.PROGRAMMER X-FTN-MSGID: 1:261/38 d48207cd X-FTN-REPLY: 1:261/38 5ab5fcd9 Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] Lines: 19 Date: Mon, 20 Aug 2012 18:58:39 GMT NNTP-Posting-Host: 69.21.70.65 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1345489119 69.21.70.65 (Mon, 20 Aug 2012 13:58:39 CDT) NNTP-Posting-Date: Mon, 20 Aug 2012 13:58:39 CDT Organization: tds.net X-Received-Bytes: 1636 Xref: csiph.com comp.lang.java.programmer:18238 To: yanamandra From: Leif Roar Moldskred yanamandra wrote: > Why does the function printall() print the base class (c1) member > values? If that is reasonable, what is the method to print the > extended class (cls) values using the base class function printall(). I take it school's back in session? The issue you're running into is called variable shadowing. Reading up on that should give you the answer to your problem. -- Leif Roar Moldskred --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24