Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19339
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: boolean statement |
| Date | 2012-10-14 21:04 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <k5fnfp$1sm$1@dont-email.me> (permalink) |
| References | <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com> |
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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
boolean statement K <kalezwe@gmail.com> - 2012-10-14 17:44 -0700
Re: boolean statement glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-10-15 00:57 +0000
Re: boolean statement K <kalezwe@gmail.com> - 2012-10-14 18:25 -0700
Re: boolean statement Lew <lewbloch@gmail.com> - 2012-10-14 21:34 -0700
Re: boolean statement Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-10-15 06:54 +0000
Re: boolean statement Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-14 21:04 -0400
Re: boolean statement Gene Wirchenko <genew@ocis.net> - 2012-10-14 18:52 -0700
Re: boolean statement K <kalezwe@gmail.com> - 2012-10-14 19:55 -0700
Re: boolean statement Gene Wirchenko <genew@ocis.net> - 2012-10-14 20:10 -0700
Re: boolean statement Jeff Higgins <jeff@invalid.invalid> - 2012-10-15 08:20 -0400
Re: boolean statement Lew <lewbloch@gmail.com> - 2012-10-15 09:15 -0700
Re: boolean statement Roedy Green <see_website@mindprod.com.invalid> - 2012-10-14 22:41 -0700
Re: boolean statement Lew <lewbloch@gmail.com> - 2012-10-15 09:15 -0700
Re: boolean statement Robert Klemme <shortcutter@googlemail.com> - 2012-10-16 01:10 -0700
csiph-web