常用类第二十九课,自动装箱和拆箱,缓存处理
来源:互联网 发布:php 报表系统 编辑:程序博客网 时间:2024/04/29 10:28
自动装箱
- 基本类型就自动地封装到他相同类型的包装中
- 如:Integer i = 100;
- 本质上是,编译器编译时我们添加了 Integer i = new Integer(100);
自动拆箱
- 包装类对象自动转换成基本类型数据。
- 如:int a = new Integer(100);
- 本质上,编译器编译时为我们添加了 int a = new Integer(100).intValue();
package com.pkushutong.Wrapper;/** * 测试自动封箱和拆箱 * @author dell * */public class Test02 {public static void main(String[] args) {//Integer a = new Integer(1000);Integer a = 1000;//jdk5.0以后,自动装箱。编译器帮我们改进代码,效果同上int c = new Integer(1500);//自动拆箱,编译器自动添加:new Integer(1500).intValue();}}
缓存问题
0 0
- 常用类第二十九课,自动装箱和拆箱,缓存处理
- java学习之旅64--常用类_自动装箱和拆箱_缓存处理
- 64_常用类_自动装箱和拆箱_缓存处理
- 自动装箱和拆箱
- 自动装箱和拆箱
- 自动拆箱和装箱
- 自动拆箱和装箱
- 自动装箱和拆箱
- 自动装箱和拆箱
- 初学者对自动装箱和自动拆箱的认识(IntegerCache的缓存数组)
- 自动装箱和自动拆箱
- java 自动装箱 和 自动拆箱
- 自动装箱和自动拆箱
- java自动装箱和自动拆箱
- Java自动拆箱和自动装箱
- 什么是自动装箱?和自动拆箱?
- Java自动装箱和自动拆箱
- JAVA自动装箱和自动拆箱
- Nginx下开启php-fpm的错误提示
- System Variable And Function, QT简单Lay Out 布局
- Android4.2和4.3中enable bluetooth
- AFNetwork 2.0在请求时报错code=3840
- 如果说中国的程序员技术偏低,原因可能在这里
- 常用类第二十九课,自动装箱和拆箱,缓存处理
- 登录下载网络资源之Java代码
- 3、如何自学Struts2之Struts2配置文件[视频]
- 2014硕果累累的一年
- RabbitMQ入门(1)
- Linux网络配置
- 7.Struts2_通配符映射
- VC++常用数据类型及其操作详解
- C#默认参数和命名参数