将包装类转换成其他数据类型
很简单,我们来看一个例子就知道了:
Integer i = new Integer(100);
//转换成double类型
double d = i.doubleValue();
System.out.println("d的值:" + d);
//转换成float类型
float f = i.floatValue();
System.out.println("f的值" + f);
相信聪明的你已经发现了其中的方法了。
很简单,我们来看一个例子就知道了:
Integer i = new Integer(100);
//转换成double类型
double d = i.doubleValue();
System.out.println("d的值:" + d);
//转换成float类型
float f = i.floatValue();
System.out.println("f的值" + f);
相信聪明的你已经发现了其中的方法了。