Multiple choice technology programming languages

Which of the following lines are not valid declarations?

  1. char a = '\u0061';

  2. char 'a' = 'a';

  3. char \u0061 = 'a';

  4. ch\u0061r a = 'a';

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Option B 'char 'a' = 'a';' is invalid because variable names cannot be enclosed in single quotes. Single quotes are reserved for character literals in Java. Options A, C, and D demonstrate valid Unicode escape sequences in Java identifiers and literals.