⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sample12_6.java

📁 Java SE 6.0前12-16章示的示例代码,简单易学
💻 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 + -