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

📄 sample12_1.java

📁 Java SE 6.0前12-16章示的示例代码,简单易学
💻 JAVA
字号:
package wyf.jc;
public class Sample12_1
{
	public static void main(String[] args)
	{
		//Character类构造器	
		Character c1=new Character('H');
		//打印Character对象
		System.out.println("Character封装类对象封装的值为:"+c1+"。");
		//Boolean类构造器
		Boolean b1=new Boolean(true);
		Boolean b2=new Boolean("TRUE");
		Boolean b3=new Boolean("FaLsE");
		Boolean b4=new Boolean("HaHa!!!");
		//打印4个Boolean对象
		System.out.print("Boolean封装类对象封装的值为"+b1);
		System.out.print("、"+b2);
		System.out.print("、"+b3);
		System.out.println("、"+b4+"。");
		//Float类构造器
		Float f1=new Float(12.56f);
		Float f2=new Float(12.56);
		Float f3=new Float("12.56f");
		//打印3个Float对象
		System.out.print("Float封装类对象封装的值为:"+f1);
		System.out.print("、"+f2);
		System.out.println("、"+f3+"。");
		//其他类型构造器
		Integer i1=new Integer(50);
		Integer i2=new Integer("50");
		System.out.print("Integer封装类对象封装的值为:"+i1);
		System.out.println("、"+i2+"。");
		Integer i3=new Integer("qq50");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -