Is that when we use then as literals value for assigning to a character we cannot use their hexadecimal equivalent. For eg: char c = '\u000a' gives compile error. so we have to use char c = '\b'; Pls. correct if wrong and explain to me.
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
JLS 3.2 explains very well that topic... but char c = '\u000a'; is not allowed because when compiled the line would look like this: char c = ' '; //note the line break Val
Just to further Val's post, you cannot use '\u000A' or '\u000D' in a String literal or in single-line comments. One of the first things the compiler does is evaulate Unicode literals. The above are intrepeted literally as 'newline' and 'carriage return'. They will break your code. Always use '\n' and '\r' ------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform