Originally posted by John Paverd:
As a good programming practice, I would always use the escape sequences instead of the Unicode values. I was only able to use \u0008, \u0009, and \u0022 in a char literal without compilation error.
Originally posted by John Paverd:
\d and \l are not valid because they:
are not one of the above escape sequences
are not unicode values (do not start with \u)
are not octal values (do not start with \digit
Question 7
1. class Green {
2. public static void main (String[] args) {
3. char a = '\b';
4. char b = '\c';
5. char c = '\d';
6. char d = '\f';
7. char e = '\l';
8. char f = '\n';
9. char g = '\r';
10. char h = '\t';
11. char i = '\\';
12. char j = '\"';
13. char k = '\'';
14. }
15. }
What is the result of attempting to compile and run the program?
a. Compiler error at line 3.
b. Compiler error at line 4.
c. Compiler error at line 5.
d. Compiler error at line 6.
e. Compiler error at line 7.
f. Compiler error at line 8.
g. Compiler error at line 9.
h. Compiler error at line 10.
i. Compiler error at line 11.
j. Compiler error at line 12.
k. Compiler error at line 13.
l. None of the Above