Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: boolean statement Date: Sun, 14 Oct 2012 21:04:55 -0400 Organization: A noiseless patient Spider Lines: 45 Message-ID: References: <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 15 Oct 2012 01:04:58 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ffb8f7085759b339c1002252b48331a4"; logging-data="1942"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198xht5Kb3cCX96AkjnusPK" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com> Cancel-Lock: sha1:ZIAGHctLZh2FQrKvtwu401sjR2o= Xref: csiph.com comp.lang.java.programmer:19339 On 10/14/2012 8:44 PM, K wrote: > Why does my boolean statement have an error message next to it in eclipse? Probably because the variable `eachKidGetsTen' is not used. It is given a value, but that value is never therafter consulted. (For future reference: When you have a question about an "error message," it is a good idea to quote the exact text of the message. In this instance I imagine there was no text at all, but still: Some description of the "error message" would have been a good idea. As it is, I'm just guessing -- And, as SH taught us, "It is a capital mistake to theorize before you have all the evidence." But since I theorize ante-factually only because you force me to, the offense is not mine but yours. Off with your head!) > public class boolean1 { > > public static void main(String[] args) { > int gumballs; > int kids; > int gumballsPerKid; > boolean eachKidGetsTen; > > gumballs = 140; > kids = 15; > gumballsPerKid = gumballs / kids; > > System.out.print("True of False? "); > System.out.println("Each kid gets 10 gumballs"); > eachKidGetsTen = gumballsPerKid >= 10; > System.out.println("eachKidGetsTen"); If you removed the " marks, I bet it would pacify Eclipse. > > } > > } > -- Eric Sosman esosman@comcast-dot-net.invalid