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(); } }
posted on 2011-12-29 19:04 java课程设计例子 阅读(839) 评论(0) 编辑 收藏 举报