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 unclosed character literal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "unclosed character literal" Watch "unclosed character literal" New topic
Author

unclosed character literal

Stefan Geelen
Ranch Hand

Joined: Nov 19, 2001
Posts: 49
Hi ,

I have following char[] array (partially reproduced:



The problem is that my compiler (NetBeans) gives an ' unclosed character literal' error for the values 096 and 097, but not 100 and 101.

Any idea why ?

Regards
Jimmy Die
Ranch Hand

Joined: Nov 20, 2003
Posts: 97
Hi,

I don't see a comma after your 'A' in your array definition. I would check this first.


Jimmy Die
Stefan Geelen
Ranch Hand

Joined: Nov 19, 2001
Posts: 49
Hi,

that was just a typo error when entering the message. It is correct is my Editor .

I have the impression that NetBeans is wrong here. Can someone else try this in another editor ?

Stefan
Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32
I think that you cannot have the digits 8 or 9 as part of the char that you are defining.

For ex. '\107', '\777', 'A', 'E', 'Z' are valid values ... but '\108', '\901' are not.
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
I also don't see a closing semicolon to end the statement. Plus, the format for the characters should be Unicode:



To use Octal:


[ October 25, 2004: Message edited by: Jeff Bosch ]

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Stefan Geelen
Ranch Hand

Joined: Nov 19, 2001
Posts: 49
Hi, thanks for the solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unclosed character literal
 
Similar Threads
Compile time Difference between // and /* */
Set value of char and String ?
unicode character
char
char declaration