This content has been marked as final. Show 2 replies
You can't have spaces in variable names. Perhaps you mean
boolean bean, sheared; bean = false; sheared = false; // or boolean beanSheared; beanSheared = false;
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.