package day01;
/**
* valueOf
* 若干方法重载
* 作用:将基本类型转换为字符串
* @author Administrator
*
*/
public class StringDemo9 {
public static void main(String[] args) {
int i = 100;
double d = 152.365;
String is = String.valueOf(i);
System.out.println(is);
String ds = String.valueOf(d);
System.out.println(ds);
String cs = is + ds;
System.out.println(cs);
String str = 100+"";
System.out.println(str);
}
}
运行结果: