java编程之int类型与String类型相互转换

130 阅读1分钟

package cn.com.service;

public class Cos {

/*author:命运的信徒

* arm:list制定位置插入数据

* date:2020-1-3 */

public static void main(String[] args) {

//int类型转换为String类型

int a=30;

String ab=Integer.toString(a);

System.out.println(ab);

//String类型的转换为int类型的

String s="55";

int d=Integer.parseInt(s);

System.out.println(d);

}

}