Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19340
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2012-10-14 18:25 -0700 |
| References | <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com> <k5fn16$gee$1@speranza.aioe.org> |
| Message-ID | <5bc3ab28-64fa-4edf-97b1-847a8c37c6f9@googlegroups.com> (permalink) |
| Subject | Re: boolean statement |
| From | K <kalezwe@gmail.com> |
On Sunday, October 14, 2012 5:57:12 PM UTC-7, glen herrmannsfeldt wrote:
> K <kalezwe@gmail.com> 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");
>
>
>
> > }
what do you mean? How do you use the value of the variable? how would I fix my code?
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