JAVA包装类Boolean的使用
JAVA包装类Boolean的使用
对于Boolean类使用了字符串构造方式,并且之后使用了toString()方法将true和false以字符串形式输出。
- /**
- * 对于Boolean类使用了字符串构造方式,并且之后使用了toString()方法将true和false以字符串形式输出。
- * @author HAN
- *
- */
- public class BooleanApps {
- Boolean b1=new Boolean("true");
- String str1= b1.toString();
- Boolean b2=new Boolean("OK");
- String str2= b2.toString();
- public BooleanApps(){
- System.out.println(str1);
- System.out.println(str2);
- }
- public static void main(String[] args){
- new BooleanApps();
- }
- }
评论暂时关闭