File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 2398
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.
I agree. Here's the link:
subject: Unicode Characters
It's not a secret anymore!