当前位置:网站首页>基本类型和包装类的区别
基本类型和包装类的区别
2022-06-28 05:55:00 【不会code的coder】
区别:
1.基本类型存储在栈里,包装类型存储在堆里。因为栈的效率更高,所以保留了基本类型。
2.包装类是对象,拥有方法和字段,对象的调用是引用对象的地址。
3.基本类型是值传递,包装类是引用传递。
4.向ArrayList,LinkedList中放数据的时候,只能放Object类型的,基本类型放不进去。
基本类型,包装类 以及其默认值,包装类的默认值为Null。
byte 0 Byte
short 0 Short
int 0 Integer
long 0 Long
float 0.0 Float
double 0.0 Double
char 空格 Character
boolean false Boolean
边栏推荐
- Bidirectional level conversion circuit
- UICollectionViewDiffableDataSource及NSDiffableDataSourceSnapshot使用介绍
- 6. graduation design temperature and humidity monitoring system (esp8266 + DHT11 +oled real-time upload temperature and humidity data to the public network server and display the real-time temperature
- Linked list in JS (including leetcode examples) < continuous update ~>
- Drop down box for implementation
- 使用SQL select count distinct查询语句统计数据库中某个字段的唯一值总数量
- 马赛克数据增强 mosaic
- 数据仓库:DWS层设计原则
- Global country (and region) information JSON data
- 猿粉猿动力-开发者活动袭!
猜你喜欢
函数栈帧的创建和销毁
Application of Beidou No.3 short message terminal in dam safety monitoring scheme
上海域格ASR CAT1 4g模块2路保活低功耗4G应用
若依实现下拉框
Oracle condition, circular statement
Openharmony gnawing paper growth plan -- json-rpc
Jenkins continuous integration 1
Filecoin hacker song developer competition
自定义 cube-ui 弹出框dialog支持多个且多种类型的input框
RL 实践(0)—— 及第平台辛丑年冬赛季【Rule-based policy】
随机推荐
Important basis for ERP software company selection
上海域格ASR CAT1 4g模块2路保活低功耗4G应用
6. 毕业设计温湿度监控系统(ESP8266 + DHT11 +OLED 实时上传温湿度数据给公网服务器并在OLED显示屏上显示实时温湿度)
5GgNB和ng-eNB的主要功能
使用SSM框架,配置多个数据库连接
Use of JDBC
Jenkins继续集成2
Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application
安装 Ffmpefg
Oracle condition, circular statement
PS effect understanding record 2 color_ dodge color_ burn
Capacity scheduling absolute value configuration queue usage and pit avoidance
bash install.sh ********错误
预训练模型参数不匹配
数据中台:AI中台的实施与总结
ES9023音频解码芯片的工作原理
@Autowired注解为空的原因
脚本语言和编程语言
Jenkins continuous integration 1
猿粉猿动力-开发者活动袭!