[Solved] Unexpected type Average


You meant:

sum = sum + one; // or sum += one;

By command prompt, I think you actually mean the compiler (which can write its error messages to the command prompt). The error message will be stating that the result of (sum + one) is not a variable.

See section 15.26. Assignment Operators of the Java Language Specification, which states:

The result of the first operand of an assignment operator must be a variable, or a compile-time error occurs.

solved Unexpected type Average