Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: subhabangalore@gmail.com Newsgroups: comp.lang.java.help Subject: Re: Data Encapsulation Question Date: Sat, 11 Aug 2012 13:40:45 -0700 (PDT) Organization: http://groups.google.com Lines: 75 Message-ID: <0659ec43-ed89-4e5e-bb3e-e7b4347ed319@googlegroups.com> References: <6jbd28tbfbfrvgl8hm8b6ironhgpggcngo@4ax.com> NNTP-Posting-Host: 122.161.34.135 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1344722335 29378 127.0.0.1 (11 Aug 2012 21:58:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 11 Aug 2012 21:58:55 +0000 (UTC) Cc: Roedy Green In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=122.161.34.135; posting-account=6SonuQoAAACzSakS5dCECcJQe6ylLrzY User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.help:1992 On Sunday, August 12, 2012 1:59:30 AM UTC+5:30, (unknown) wrote: > On Sunday, August 12, 2012 12:42:14 AM UTC+5:30, Roedy Green wrote: > > > On Fri, 10 Aug 2012 12:13:00 -0700 (PDT), subhabangalore@gmail.com > > > > > > wrote, quoted or indirectly quoted someone who said : > > > > > > > > > > > > >Thanks it worked. The code is working but only "Size:" of System.out.println("Size:"+b.getsize()); is giving error, if you drop it --it is coming nicely. > > > > > > > > > > > > Just copy and paste the output of the program. The code looks fine. > > > > > > -- > > > > > > Roedy Green Canadian Mind Products http://mindprod.com > > > > > > A new scientific truth does not triumph by convincing its opponents and making them see the light, > > > > > > but rather because its opponents eventually die, and a new generation grows up that is familiar with it. > > > > > > ~ Max Planck 1858-04-23 1947-10-04 > > > > Dear Sir, > > Thank you for your kind concern. The following error message is coming: > > Exception in thread "main" java.lang.Error: Unresolved compilation problem: > > The method getsize() is undefined for the type Box > > > > at BoxMain.main(BoxMain.java:16) > > Regards, > > Subhabrata. Dear Group, No. The Code had a very silly mistake. If you see, I am writing System.out.println("Size:"+b.getsize()); while I am calling, but while declaring I am writing it as, public void setSize(int newSize) { size = newSize; } The 'S' of "setSize" is capital here. I changed and worked fine. When all of you were saying the syntax and structure is fine, I tried to zoom into the code. Thank you all for your kind time. By the way, Lew was trying to suggest me something regarding command line, Ant, etc. I am bit curious to know them. If you can help. Regards, Subhabrata.