java 数字转字符串

java问题求教,急。。。。。。。。。。
将数字0—36变成0—9,A—Z,怎样写程序,急,在线等,谢谢帮忙!!!!

各种数字类型转换成字符串型:

String s = String.valueOf( value); // 其中 value 为任意一种数字类型。

字符串型转换成各种数字类型:

String s = "169";
byte b = Byte.parseByte( s );
short t = Short.parseShort( s );
int i = Integer.parseInt( s );
long l = Long.parseLong( s );
Float f = Float.parseFloat( s );
Double d = Double.parseDouble( s );

数字类型与数字类对象之间的转换:

byte b = 169;
Byte bo = new Byte( b );
b = bo.byteValue();

short t = 169;
Short to = new Short( t );
t = to.shortValue();

int i = 169;
b = bo.byteValue();

short t = 169;
Short to = new Short( t );
t = to.shortValue();

int i = 169;
Integer io = new Integer( i );
i = io.intValue();

long l = 169;
Long lo = new Long( l );
l = lo.longValue();

float f = 169f;
Float fo = new Float( f );
f = fo.floatValue();

double d = 169f;
Double dObj = new Double( d );
d = dObj.doubleValue();
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-02-04
String[] strs=new String[37];
for(int i=0;i<=36;i++){
if(i<=9){
strs[i]=i+"";
}else{
strs[i]=(char)(i+55)+"";
}
System.out.print(strs[i]+",");
}本回答被提问者采纳
第2个回答  2009-02-04
String str=String.valueOf(123);
str就是字符串123了

将数字0—36变成0—9,A—Z,是ascii编码转换,不过题目不清;

我明白楼猪的意思的,是36进制数0-36转换,哈哈,lymeng520那样就ok了
第3个回答  2009-02-04
0-9不需要转换

10-36 转换成A-Z的话
只需要将10加上55 然后强制转换成char类型就是A了
11之后的转换方法是一样的。
第4个回答  2009-02-04
Integer.toString(35, 36);
前一个参数为欲转换的数字, 后一个参数为进制
第5个回答  2009-02-04
转换的规则是什么呀? 0-36 怎么转换成 0-9 ,A-Z!??
第6个回答  2009-02-13
二进制???
十六进制???

ASKII???

你到底在说什么啊LZ?
相似回答