1、基本类型数据+“”

int a=1;
String s=a+"";//"1"
  • 1.
  • 2.

2、String转换为对应的基本类型

包装类中的parseXXX()

int i=Integer.parseInt("100");//100
  • 1.