hi, i need some help i am getting confused with this char initialization how come u can have this '\u000b','\u0a00','\uface'etc but u can't have '\u000a'? i don't get it pls explain to me
posted 13 years ago
If you look at the Unicode Chart you will see that: \u000A is a linefeed \u000B is a vertical tab \u000C is a form feed (page separator) \u000D is a carriage return etc. Then you need to remember that when handling your code the compiler -first converts all the typed characters to unicode, -second DOES all the unicode commands -third starts looking at your code to begin compiling it. Well if you have a \u000a in the middle of a line of code the linefeed is going to happen before any compiling occurs. The effect is that the line will be split into 2 logical lines as far as the compiler is concerned and you will get syntax errors for not completing whatever command that you were doing. The other unicode expressions are just characters that are not print commands and therefore do not muddle up your syntax.
"JavaRanch, where the deer and the Certified play" - David O'Meara