This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "System.out.println((char)-1) printing question mark" Watch "System.out.println((char)-1) printing question mark" New topic
Author

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

Azuritul Wu
Greenhorn

Joined: Apr 21, 2004
Posts: 8
Hello,

In my program I write:

System.out.println((char)-1);

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?


Preparing...
Abhinay Verma
Greenhorn

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

Joined: Apr 21, 2004
Posts: 8
Many thanks for your reply...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System.out.println((char)-1) printing question mark
 
Similar Threads
why is char doing strange things?
char c = 'b'-'a' --No Compile error??????????
FileConnection
urgent ..please look at code
the argument of method mark() does not work