📄 sample12_1.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 + -