wood burning stoves
The moose likes Beginning Java and the fly likes System.out.println((char)-1) printing question mark Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System.out.println((char)-1) printing question mark" Watch "System.out.println((char)-1) printing question mark" New topic

System.out.println((char)-1) printing question mark

Azuritul Wu

Joined: Apr 21, 2004
Posts: 8

In my program I write:


And the console output is ?.....Can anybody tell me why?
Is this because Java don't recognize this character, so just transforms it to ? mark?

Abhinay Verma

Joined: Dec 13, 2004
Posts: 24
You are right. If Java doesn't recognize the code, it will print '?'
Azuritul Wu

Joined: Apr 21, 2004
Posts: 8
Many thanks for your reply...
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: System.out.println((char)-1) printing question mark
It's not a secret anymore!