Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: A question about some long java code that has getters/setters Date: Fri, 22 Jul 2011 16:51:58 -0700 Organization: A noiseless patient Spider Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 22 Jul 2011 23:52:02 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="7zTeebvKpIS8LVJ5OFDmwg"; logging-data="13635"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/B2RDDzuZ+W0AjdxkKYF24NiSAAvtfb7Q=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:rop9hGSrc6Qkrlx6S0zI+uJCdYM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6439 On 7/22/2011 4:12 PM, 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 Dead code is often a fact of life. OTOH, some reasonable reasons might be: Those methods are called by a unit test harness, which is not shown. Those methods are used elsewhere in a different code base, and this class is a general purpose class developed by the author as part of his text book. You might look ahead and see if this class appears again in the book, maybe with the "unused" methods invoked there.