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 Casting between char and Numeric Types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Casting between char and Numeric Types" Watch "Casting between char and Numeric Types" New topic
Author

Casting between char and Numeric Types

Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
hi all

in a book i was reading, it said -> Character A's Unicode is \u0041.

when i use type conversion



output is 97 ...

QUESTION: what i am missing here ?

thanks for your help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Character A and character a are not the same.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
yes ..agreed

but it still wont print "\u0041" either for 'a' OR 'A'

thanks
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7892
    
  21

Abid Ramay wrote:but it still wont print "\u0041" either for 'a' OR 'A'

What does it print out for 'A'?

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
65
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18876
    
  40

Abid Ramay wrote:65



Hint: What is 65 as a hexadecimal number?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Abid Ramay
Ranch Hand

Joined: Apr 06, 2013
Posts: 43
ok cool man. got it.

thanks a mill.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Casting between char and Numeric Types