1:每一个基本类型都对应一个包装类型 long->Long int->Integer short->Short btye->Byte double->Double float->Float boolean->Boolean 2:基本类型和包装类型的转换 法一: Interger a=new Interger(10); int b=a.intValue(); 法二: Integer k=123; int m=k; 例子:
package my
;
public class Hello {
public static void main(String
[] args
) {
String str
="123";
int a
=Integer
.valueOf(str
);
String s
=String
.valueOf(339);
System
.out
.println("the result:"+a
);
System
.out
.println("the result:"+s
);
}
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-51736.html