Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19338

Re: boolean statement

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.lang.java.programmer
Subject Re: boolean statement
Date 2012-10-15 00:57 +0000
Organization Aioe.org NNTP Server
Message-ID <k5fn16$gee$1@speranza.aioe.org> (permalink)
References <81d2cb8c-292b-4efd-9a42-ac8ef0f86d0e@googlegroups.com>

Show all headers | View raw


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");

>        }

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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