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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -