0

While I was trying for something else, my eyes got stuck to this:

When I declare a string using Unicode code values as:

String s1="\u000B";                    \\ OR
String s2="\u111A and its fine";        \\ OR
String s3="\u111D and this is fine too"; 

The above three declarations are just fine. But when i declare my String with following two Unicode values (\u000A and \u000D) as:

String s4="\u000A";                   \\ OR
String s5="\u000D";                     \\ OR
String s6="\u000A and this isn't fine";  \\ OR
String s7="\u000D and neither this";   

Then I am recieving an " Unresolved Compilation Error: String literal is not properly closed by a double-quote."

Waht is there so special about these two Unicode values which is generating this error?

Amitesh Rai
  • 846
  • 11
  • 21
  • 5
    This will explain what happens: [Why can't I use \u000D and \u000A as CR and LF in Java?](http://stackoverflow.com/questions/3866187/why-cant-i-use-u000d-and-u000a-as-cr-and-lf-in-java) – Obicere Sep 03 '14 at 20:50
  • @Obicere, thanks for the link – Amitesh Rai Sep 03 '14 at 20:55

0 Answers0