File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes chars 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 » Java » Java in General
Bookmark "chars" Watch "chars" New topic
Author

chars

khella smith
Ranch Hand

Joined: May 06, 2002
Posts: 39
hi,
i need some help i am getting confused with this char initialization how come u can have this '\u000b','\u0a00','\uface'etc but u can't have '\u000a'?
i don't get it pls explain to me
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you look at the Unicode Chart you will see that:
\u000A is a linefeed
\u000B is a vertical tab
\u000C is a form feed (page separator)
\u000D is a carriage return
etc.
Then you need to remember that when handling your code the compiler
-first converts all the typed characters to unicode,
-second DOES all the unicode commands
-third starts looking at your code to begin compiling it.
Well if you have a \u000a in the middle of a line of code the linefeed is going to happen before any compiling occurs. The effect is that the line will be split into 2 logical lines as far as the compiler is concerned and you will get syntax errors for not completing whatever command that you were doing.
The other unicode expressions are just characters that are not print commands and therefore do not muddle up your syntax.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: chars
 
Similar Threads
expression language
Is it required to re-start the web, application servers when a class file is changed
Software valuable or not
defautl button?
runtime native objects into browser