Originally posted by Soni Prasad: Problem is because of \u000A in //char a='\u000A'; where \u000A is \n and this line is treated as
//char a=' ';
in tony morris website its written
The compiler will fail because of the Unicode escape in what appears to be (but is not) a single line comment. The Unicode escape \u000A is lexically translated before compile-time into a Line Feed character, therefore, the next line, `; will cause the compiler to fail.
but i have heard that anything behind // will be completely ignored but this is bit strange
but i think this will not true in /* */ type of comments
according to tony... he say unicode is translated before complile time... what this ?? howz that posible...as java compiler will know everything about code when compling..howz before that
pls explain...and what do u mean by lexically trnaslated ???
Thanks and Regards, Amit Taneja
Joined: Sep 24, 2003
amit, On that same web page there is a reference to the Java Language Specification that explains lexical translation of Unicode Escapes (which occurs prior to compilation). See if that helps.