Multiple choice technology programming languages

class MCZ27 { public static void main (String[] args) { char a = '\f'; // 1 char b = '\n'; // 2 char c = '\r'; // 3 char d = '\l'; // 4 char e = '\'; // 5 }} A compile-time error is generated at which line?

  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

  6. No errors

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

\l is not a valid Java escape sequence. Valid escapes are \b (backspace), \t (tab), \n (newline), \f (form feed), \r (carriage return), \' (single quote), \' + " (double quote), and \ (backslash). Attempting to use \l causes a compile-time error.