Try: IfirstValue = IfirstValue + IfirstValue;. or IfirstValue + = IfirstValue;. Also, please avoid starting variable names with capital letters, it violates Java' s coding convention. There' s a few mistakes with this code. You' re not concatenating correctly on any of your print to consoles. println( " The opposite of" n " is" opposite) ;. should be: System. println( " The opposite of" + n + " is" +. You did not actually use a minus ( - ) sign, but something else. Try to delete it and add another - sign instead. Therefore if ( tips = true) is valid syntax, because tips = true is both an assignment and also a boolean.
eclipse such as " The operator < = is undefined for the argument type( s) boolean, Boolean" or from javac such as " error:. Your example is invalid because " - = " is actually a contracted form:. Assign the computation to something else:. this grammar, therefore if any statement is not following these grammatical rules, result into syntactical error. Assuming that your " YourBmi" has a double value, make this changes: EDITED: I changed the else if code. It has to much parenthesis and add another if in last alse. valueOf( YourBmi) < = 18. should give an error something like this:. If you want to set i to null use the simple assignment operator = : i = null;. that just because something is a valid expression doesn' t mean that that thing, by itself, is a valid statement. for an extended discussion, please refer to: Why can' t I do assignment outside a method? Statements should be placed in inside constructors/ methods/ blocks, otherwise Compile time error occurs. put( " + ", 2) ;. That leaves your return count; and final } hanging in the middle of a class definition where it' s not valid syntax.
return count; is outside the method and you have a ; after your if that shouldn' t be there, after good indentation. I got the same error when I imported a project I created in a Mac, to Windows. If you move your cursor through the characters and your cursor doesn' t move in one character, that means there is an invalid character in the line.