File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt in  Literals Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "doubt in  Literals" Watch "doubt in  Literals" New topic
Author

doubt in Literals

Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
The compiler interprets \u000a as a line terminator. The escape sequence \n should be used instead.
Similarly, \u000d is interpreted as a line terminator. The escape sequence \r should be used instead.

what does this mean??
Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
It means suppose u have a declaration like
char a = '\u000a';

The compiler interprets it as
char a = ;
Same applies for '\u000d'

which is obviously a compilation error
Lavanya ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Thanks.
S it's compilation error.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

"lavanyapmr "-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
char a = '\u000a';

I think the compiler will interpret it like this :

char a = '
';

And thatswhy it gives compile time error .

please correct me if I am wrong ...

Thanks .
Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
i guess u right,
because its a new line
anyways, whatsoever we get a compiler error
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in Literals