This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes character interpretation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "character interpretation" Watch "character interpretation" New topic
Author

character interpretation

roja potti
Greenhorn

Joined: Mar 30, 2004
Posts: 15
this is my code
class chrI
{
public static void main(String[] args)
{
String a="\u000a"; //here
String b="\u000d"; //here
System.out.println("a= " +a);
System.out.println("b= " +b);
}
}
When I compile this code I am getting an error saying unclosed string literal( where I mentioned as here).
When I try the same code with "\u000b","\u000c","\u000e","\u000f" I am getting no error.
I am not understanding why???
Could you help me???
Dan Andrei
Ranch Hand

Joined: Jan 21, 2004
Posts: 92
Hi
'\u000d' = CR – carriage return complle error if used like this, use instead ‘\r’
'\u000a' = LF – line feed return sa also compile error, if used like this , use instead ‘\n’
Both of the above are line terminators, and give compile errors so you can think of them as "reserved Unicode"
for more details look at JLS chap 3
Hope that helps
Dan


"Did anyone understand what I have just explained? ... because I did not!"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: character interpretation
 
Similar Threads
Cannot find symbol error
throws Error
Console class
exceptions