Boxing and Unboxing
来源:互联网 发布:js时间戳转换日期函数 编辑:程序博客网 时间:2024/05/01 20:16
请预测下面程序运行的结果:
正确结果是:
True
False
你“目测”的结果对吗?
至于原因情况下面的这段E文解释:
A further subtlety is that boxed values may be cached. Caching is required when boxing an int or short value between -128 and 127, a char value between '/u0000' and '/u007f', a byte, or a boolean; and caching is permitted when boxing other values. This is because 6 is smaller than 128, so boxing the value 6 always returns exactly the same object.
Even for small values, for which == will compare values of type Integer correctly, we recommend against its use. It is clearer and cleaner to use equals rather than == to compare values of reference type, such as Integer or String.
- 11.3 Boxing and unboxing
- Boxing and Unboxing
- Boxing and Unboxing
- Boxing and Unboxing
- BOXING AND UNBOXING FOR BEGINNER
- Boxing and unboxing in C#
- boxing, unboxing
- Java Auto Boxing and Unboxing -Java 学习笔记 (23)
- CLR 是怎样去处理Boxing and Unboxing Value Types?
- Effective C#之17:Minimize Boxing and Unboxing.
- 关于Boxing和Unboxing
- 关于boxing 和 unboxing
- C#的Boxing/Unboxing解析
- java中的Boxing和unboxing
- java中的auto-boxing/unboxing
- 6 important .NET concepts: - Stack, heap, Value types, reference types, boxing and Unboxing.
- C#中装箱和拆箱的作用 the effection of boxing and unboxing
- C#中的"装箱"(boxing)与"拆箱"(unboxing)
- Firebird 开源关系数据库,支持嵌入模式与客户端/服务器模式
- IBPP, a C++ Client Interface to Firebird Server
- 不闲恶心 的就看..
- Powerbuilder IE图片按钮
- PHP中查看错误log
- Boxing and Unboxing
- 感人么?
- easyExcel.py
- Nagios - The Industry Standard In Open Source Monitorin
- 从Win32程序中的主函数中获取命令行参数
- 个人开公司的流程
- DCT变换
- android学习笔记之3D---多边形着色(颜色)
- c# winform 让Form窗体上系统自带的红色关闭按钮失效,点击关闭变为最小化