[Solved] When assigning a value Java gives the error ‘java: expected’, Why? [duplicate]


Your’re probably not using it in a method. Place it in a method as shown below :

public static void main(String[] args) {

    char aCharacter="A";

    aCharacter="\u0041";
}

This is because assignments are statements and statements are allowed only inside blocks of code.

0

solved When assigning a value Java gives the error ‘java: expected’, Why? [duplicate]