aspose 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 17249
    
    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
 
Don't get me started about those stupid light bulbs.
 
subject: doubt in Literals
 
Similar Threads
Strange output
confused with new line and unicode
Regular Expression Help
dan exam dought
interesting problem in char