[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

numebrs to alphabets  in java

Posted on 2007-04-04
5
Medium Priority
?
192 Views
Last Modified: 2010-03-31
hi guys

If i have series of numbers say
1
2
3
4
5
..... and so on

how can i convert that to char format like

a
b
c
d
e
f
..... and so on



so basically
a corresponds to 1
b corresponds to 2
c corresponds to 3
and
so on ...

any one who can provide java code to do that will be greatly appreciated
thanks very much
J

0
Comment
Question by:jaggernat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 18853992
char alpha = (char)(i + 'a' - 1);

(where 'i' is your integer)
0
 
LVL 12

Expert Comment

by:keyurkarnik
ID: 18866865
You need to take the ascii value of character 'a' which is 97 and then do this :

char val = char(num + 96)

OR for Capital alphabets :

char val = char(num + 64)
0
 
LVL 12

Expert Comment

by:keyurkarnik
ID: 18866886
replace num by your integer value
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question