Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newsfeed2.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: A question about some long java code that has getters/setters 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: 22 Jul 2011 23:31:59 GMT Lines: 18 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1311377519 tunews.univie.ac.at 73248 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6437 Chad wrote: > What I don't get is why the book defines stuff like getXCoordinate(), > getYCoordinate(), and getInterval() when it doesn't even use them in > this very long code example. ... I can't speak for the authors, but I might have included these into a book for a few reasons: get the students more used to correctly camelCasing method names, and because they are standard methods typically found in widget libraries. > public Dimension getPreferredSize() { > return new Dimension(200, 30); > } Some others of these methods like getPreferredSize() are called by the framework, but I wouldn't expect that for the methods you speci- fically asked about.