A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
Programmer Certification (SCJP/OCPJP)
Joined: Nov 26, 2006
Nov 26, 2006 00:15:00
Pls explain why does the following code generates Compile-Time Error
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
Joined: Feb 07, 2005
Nov 26, 2006 07:24:00
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
strange problem in comments.
Unicode charector as String literal; finalize() method
dan exam dought
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014