This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting alphabets from ascii

 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All
Is there any method in java which return value from ASCII.
Thanks
kundan
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite getting the question. Can you show me what you'd expect such a method to do? What would you like to provide as input and get as output?
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Java uses Unicode and not ASCII. but the ASCII character set forms the first 255 characters of Unicode, so all the ASCII values remain unchanged.

You can do a simple typecast to get the value.

int a = 65;
char ch = (char)a;

will assign 'A' to ch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic