Hi guys.... char a = '\u000A'; gives a compiler error but char a = '\u000B'; compiles cleanly...... Can't seem to figure out the correct range of a CHAR literal.... Can anybody throw some light on this??? Thanks....
Remember unicode escapes are processed before actual compilation. Thus your code char a = '\u000A'; becomes char a = ' '; as \u000a is the new-line character
That is clearly an error. Also check-out '\u0027' which is single-quote char a = '\u0027'; means char a = '''; and '\u005c' which is back-slash. char a = '\u005c'; means char a = '\';
Does this mean that one has to remember/memorize all of these codes so that questions of these types in the SCJP can be answered correctly??? That'll be tough!!!
What a show! What atmosphere! What fun! What a tiny ad!
Gift giving made easy with the permaculture playing cards