aspose 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


Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 62123
    
  68

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: 8626
    
  23

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: 19336
    
  41

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.
 
Consider Paul's rocket mass heater.
 
subject: Casting between char and Numeric Types