aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Unicode Characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Unicode Characters" Watch "Unicode Characters" New topic

Unicode Characters

manisha ankolekar

Joined: Nov 26, 2006
Posts: 10
Pls explain why does the following code generates Compile-Time Error

String a="\u000a";//Unicode value for NewLine

String b="\u000d";//Unicode value for Carriage Return

My second question is:Wat is the use of Carriage Return???

Also explain why doesnt this code generate Error

String c="\u0008";//Unicode value for Backslash

String d="\u0009";//Unicode value for Tab

Pls help
Thank u
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
The UNICODE escapes are processed early so you are not allowed to use the UNICODE escapes for carriage return and line feed. Look at the Java Language Specification 3.4.
It is sorta covered in the JavaRanch Style Guide.
subject: Unicode Characters