Java - 将int更改为ascii [英] Java - Change int to ascii
本文介绍了Java - 将int更改为ascii的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
java有没有办法将int转换为ascii符号?
Is there a way for java to convert int's to ascii symbols?
推荐答案
你要转换 int
s到 char
s?:
Do you want to convert int
s to char
s?:
int yourInt = 33;
char ch = (char) yourInt;
System.out.println(yourInt);
System.out.println(ch);
// Output:
// 33
// !
或者你想转换 int
s到字符串
s?
Or do you want to convert int
s to String
s?
int yourInt = 33;
String str = String.valueOf(yourInt);
或者你的意思是什么?
这篇关于Java - 将int更改为ascii的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文