File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes char assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "char assignment" Watch "char assignment" New topic
Author

char assignment

Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

Hi all,
I am new in this forum and have a basic question.
Why this code does not compile?

Thanks for your help.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Although this question is more frequently asked in the SCJP forum, when I did a search in this forum (using \u000A) I found several including:

this one with the following response
Originally posted by Mike Gershman:
If you put '\u000a' or '\u000d' in a source program, the compiler treats it as an actual line break in your program text and breaks your statement into two lines, both of which will probably have a syntax error.

You need to use '\n' or '\r'.


and these which may clarify further if you want more detail:

http://www.coderanch.com/forums/

http://www.coderanch.com/t/390266/java/java/Invalid-Chararcter-constant

http://www.coderanch.com/t/389165/java/java/uni-code


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: char assignment
 
Similar Threads
oracle syntax
chars
switch case
null terminated string for C++ Client
How do I get the '� ' symbol to appear in a JSP