字符串"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); } }
相关文章推荐
- LightOJ 1255 - Substring Frequency
- Java Gradle入门指南之内建与定制任务类(buildSrc、Groovy等)
- iOS设计之 表格UITableView 的参数与视图页面之间的相互传递
- UESTC 1146 秋实大哥与连锁快餐店
- Shape + Selector: Make a Shape as one item of the Selector
- windows客户端开发--duilib显示html
- windows客户端开发--duilib显示html
- CharSequence类
- Volley源码学习(三):线程处理request,类CacheDispatcher,NetworkDispatcher,ExecutorDelivery
- iOS UIView animation动画效果 (1)
- easyui 列表里下拉框联动
- UI进阶——SQL数据库
- android:finishOnTaskLaunch="true" //虽然这样设置了,但是Back键与Home键还是不同
- torque
- 给UIButton设置BackgroundColor:forState
- guice框架的入门使用
- (4.5.3.4)finished with non-zero exit value 2
- UI组件:PopupWindows的详细使用(一)
- U3D打包DLL插件 DLL Builder
- UITableView传值(自己使用)(属性,代理传值)