您的位置:首页 > 产品设计 > UI/UE

字符串"true"转换为布尔型boolean「true」

2016-03-16 21:27 501 查看
public class dd {
public static void main(String []arg){
String s = "true";

boolean b = Boolean.valueOf("true").booleanValue();
System.out.println(b);

boolean b1 = Boolean.valueOf(s).booleanValue();
System.out.println(b1);

boolean b2 = Boolean.parseBoolean(s);
System.out.println(b2);

Boolean bb = new Boolean(s);
boolean b3 = bb.booleanValue();
System.out.println(b3);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: