unicode - Messed up with Java Declaration -
why java constant have strange behaviour (unicode character , normal representation).. mean see below example. note : code in java language.
char = '\u0061'; //this correct char 'a' = 'a'; //this gives compile time error char \u0061 = 'a'; //this correct no error ch\u0061r = 'a'; //this works ch'a'r = 'a'; // confusing compile time error
why last declaration not works whereas ch\u0061r a='a';
works?
you cannot put literals ('a'
) in middle of identifiers.
the line
char 'a' = 'a';
does not compile because there no identifier, , cannot assign 1 literal another.
unicode permitted, however. hard read :-)
Comments
Post a Comment