Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: glen herrmannsfeldt Newsgroups: comp.lang.java.programmer Subject: Re: boolean statement Date: Mon, 15 Oct 2012 00:57:10 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 28 Message-ID: References: <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com> NNTP-Posting-Host: 0usSS01PZ8AI54GFz6in7A.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: tin/1.9.6-20100522 ("Lochruan") (UNIX) (Linux/2.6.32-5-amd64 (x86_64)) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:19338 K wrote: > Why does my boolean statement have an error message next to it in eclipse? It should be a warning, not an error, but you never use the value of the variable. Eclipse nicely tells you that you might have forgotten something. -- glen > 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"); > }