📄 sample12_6.java
字号:
package wyf.jc;
public class Sample12_6
{
public static void main(String[] args)
{
//将封装的int值转换为其他数值类型
Integer integer=new Integer("52");
byte b=integer.byteValue();
double d=integer.doubleValue();
System.out.println("将字符串“52”转换为byte值以及double值,其值为:"+b+"、"+d+"。");
//将封装的float值转换为其他数值类型
Float floatF=new Float("25.5");
float f=floatF.floatValue();
d=floatF.doubleValue();
System.out.println("将字符串“52”转换为float值以及double值,其值为:"+f+"、"+d+"。");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -