数字和字符转换

//将 数字转成字符串
Integer number = new Integer(88888);
String s = number.toString();
System.out.println(s);

//将 int 类型的数字转换成字符串
int i = 88888;
String s1 = String.valueOf(i);
System.out.println(s1);
//将String 类型的变量转换成数字
public static void main(String[] args) {
String s = "88888";
int i = Integer.valueOf(s);
System.out.println(i);
}
posted @ 2021-01-30 16:05  __sunshine  阅读(186)  评论(0)    收藏  举报