| Author |
Confusion in \uxxxx !!!
|
tanu dua
Ranch Hand
Joined: Apr 05, 2004
Posts: 145
|
|
Hi all ! I was doing Dan Chislom Language Fundamentals Exam 2 when i encountered the following problem. Please help me out. Output: Compile Error at 2 Details of error :Unclosed String literal. Problem : Why there is a compile error even though \u000a represents \n. Thanx
|
 |
JiaYun Jia
Greenhorn
Joined: Jun 28, 2004
Posts: 7
|
|
There's a faq on this at jGuru http://www.jguru.com/faq/view.jsp?EID=225894
|
 |
Tybon Wu
Ranch Hand
Joined: Jun 18, 2002
Posts: 84
|
|
Because unicode characters are translated before compile. So basically the code gets translated to the following before it's compiled: As you can see, /u000a is literally translated in to a new line in the source code.
|
SCJP2
|
 |
Ganesh Prakhya
Ranch Hand
Joined: May 05, 2004
Posts: 76
|
|
hi actually i think you forgot to include a semi colon in line 2 of your code. just behind assignment of unicode character. i think this is your reason for your compiler error. tnx
|
 |
tanu dua
Ranch Hand
Joined: Apr 05, 2004
Posts: 145
|
|
Thanx for all ur replies ,my doubts are cleared .. Thanx
|
 |
Sanyev Babu
Ranch Hand
Joined: Dec 18, 2003
Posts: 132
|
|
|
All see this thread
|
 |
 |
|
|
subject: Confusion in \uxxxx !!!
|
|
|