2 Replies Latest reply on Dec 17, 2006 4:40 AM by 807607

    help boolean

    807607
      can any one explain it is the correct way to put this becuase it show error
      and what it means
      boolean bean sheared;
                                             bean sheared = false;
        • 1. Re: help boolean
          807607
          You can't have spaces in variable names. Perhaps you mean
          boolean bean, sheared;
          bean = false;
          sheared = false;
              // or
          boolean beanSheared;
          beanSheared = false;
          • 2. Re: help boolean
            807607
            It seems your only mistake is that you have a space where there shouldnt be. You can shorten both lines to:

            boolean beanShared = false;

            Its just saying that the variable "beanshared" is false. Since it is a boolean variable then it can only be true or false.

            FYI, there are certain rules for variables such as:

            Identifiers can be made up of letters, digits, and underscore and dollar sign characters. They cannot start with a digit.

            You cannot use other symbols such as ? or %.

            Spacers are not permitted

            You cannot use reserved rules such as public.

            They are case sensitive so Greeting and greeting are different variables

            But, by convention, all variables should start with a lowercase letter.