`
- 浏览:
583097 次
- 性别:
- 来自:
杭州
-
boolean是基本数据类型;
Boolean是它的封装类,和其他类一样,有属性有方法,可以new,也可以直接赋值,例如:
Boolean a = new Boolean(true);
也可以 Boolean a = true;
Boolean 是boolean 的实例化对象类,和Integer对应int一样 ;
自jdk1.5.0以上版本后,Boolean在"赋值"和判断上和boolean一样, 即是你: boolean b1 = true ; 或者 Boolean b2 = true ; 都可以。
唯一只能使用Boolean上的就是从列表或者哈希表获取值时。 比如 boolean t = false; Map map = new HashMap(); map.put("t", t);
那么获取值时只能用 Boolean t1 = (Boolean) map.get(t); //前面只能用Boolean强制转换,不能使用boolean.
示例二:
int t = 0;
Map map = new HashMap();
map.put("t", t);
int t1 = (Integer) map.get(t);
总言:放进map中的可以是元素或者对象,拿出来的一定是一个对象,强制转换时必须使用大些Boolean或Integer
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
下面小编就为大家带来一篇详谈java中boolean和Boolean的区别。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Boolean RT资源包,可用于Unity 几何体布尔运算
BooleanRT, 实现2个物体间的布尔运算 The extension provides the following functions: 1- Real-time or per-click Boolean execution. 2- Material, UV and texture preservation. 3- Saving to prefab. 4- ...
delphi编程里的bool跟boolean类型有什么区别.mht
下面小编就为大家带来一篇JS字符串false转boolean的方法(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Unity 几何体布尔运算BooleanRT,Boolean RT.unitypackage,unity3d布尔运算插件。
boolean_approach
BooleanRT实时模型网格布尔运算插件 可以进行实时的模型合并、求差集、求交集等操作。 全网最好用的了,没有第二款。
Screen Space Boolean Subtract Shader 动态计算模型布尔值,源代码
The of Boolean Functions
主要介绍了Java if(boolean)和if(boolean=true)区别解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
Objective-C Boolean 变量 具体内容,请参考苹果开发者 Mike 的博文http://blog.sina.com.cn/s/blog_7aa21f320100r6ux.html
saliency detection a boolean map approach
用作unity3D几何体的布尔运算包用作unity3D几何体的布尔运算包用作unity3D几何体的布尔运算包
This textbook presents a survey of research on boolean functions, circuits, parallel computation models, function algebras, and proof systems. Its main aim is to elucidate the structure of "fast" ...
[C語言][教學]_基本語法#13._條件判斷if_else與布林值Boolean
Boolean RT.unitypackage,unity3d布尔运算插件。