Nope - no bug. The sequence that you used is the unicode equivalent of a linefeed. Since the codes are converted to their values BEFORE the syntax is compiled, that unicode was replaced with the linefeed, creating a file that looked like:
// char c = '
';
The first line is commented out, but not the second line, and that is invalid syntax, therefore the error.
From the
Java Language Specification:
The character and string escape sequences allow for the representation of some nongraphic characters as well as the single quote, double quote, and backslash
characters in character literals (�3.10.4) and string literals (�3.10.5).
EscapeSequence:
\ b = /* \u0008: backspace BS */
\ t = /* \u0009: horizontal tab HT */
\ n = /* \u000a: linefeed LF */
\ f = /* \u000c: form feed FF */
\ r = /* \u000d: carriage return CR */
\ " = /* \u0022: double quote " */
\ ' = /* \u0027: single quote ' */
\ \ = /* \u005c: backslash \ */
Therefore if you WANT to put a linefeed in your char you must use the supplied substitute instead.
So
you should have coded:
// char c = '\n';
[This message has been edited by Cindy Glass (edited July 11, 2001).]