回复 2楼 w123012306
源码如下:public class LangDemo1{public static void main(String[]args){
String str="12";
Byte objByte=Byte.valueOf(str);
Short objShort=Short.valueOf(str);
Integer objInt=Integer.valueOf(str);
Long objLong=Long.valueOf(str);
System.out.println(objByte);
System.out.println(objShort);
System.out.println(objInt);
System.out.println(objLong);
}
}