Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Casting between char and Numeric Types

 
Abid Ramay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Character A and character a are not the same.
 
Abid Ramay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes ..agreed

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

thanks
 
Winston Gutkowski
Bartender
Pie
Posts: 10500
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abid Ramay wrote:but it still wont print "\u0041" either for 'a' OR 'A'

What does it print out for 'A'?

Winston
 
Abid Ramay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
65
 
Henry Wong
author
Marshal
Pie
Posts: 21406
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abid Ramay wrote:65



Hint: What is 65 as a hexadecimal number?
 
Abid Ramay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok cool man. got it.

thanks a mill.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic