当前位置:网站首页>基本类型和包装类的区别
基本类型和包装类的区别
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
边栏推荐
- 阿里云短信服务(完整指南),短信发送功能实现。
- 数据仓库:DWS层设计原则
- Flink window mechanism (two waits and the last explanation)
- 自定义 cube-ui 弹出框dialog支持多个且多种类型的input框
- 数据中台:AI中台的实施与总结
- 开发者的时代红利在哪里?
- 深度学习19种损失函数
- JSP
- Relevant implementation records of CSI and local disk
- Solution of dam safety automatic monitoring system for medium and small reservoirs
猜你喜欢

独立站卖家都在用的五大电子邮件营销技巧,你知道吗?

How to do a good job of dam safety monitoring
![[CAD drawing Video] AutoCAD 2014 master's way](/img/19/7013333c028d7db02e356661b9ffc3.jpg)
[CAD drawing Video] AutoCAD 2014 master's way

How popular are FB and WhatsApp mass messages in 2022?

19 fonctions de perte d'apprentissage profond

Jenkins继续集成2

电商转化率这么抽象,到底是个啥?

Binder interview: memory management unit

cocoapod中的第三方库怎么引用本地头文件

YYGH-7-用户管理
随机推荐
简单手写debounce函数
Where is the era bonus for developers?
Qtcanpool knowledge 07:ribbon
YYGH-BUG-03
Jenkins continuous integration 1
高质量国产立体声编解码器CJC8988,Pin to Pin替代WM8988
猿粉猿动力-开发者活动袭!
【无标题】
Comparison between relational database and document database
Lhasa accordion
Binder面试之:内存管理单元
使用pytorch和tensorflow计算分类模型的混淆矩阵
YYGH-BUG-02
如何在您的Shopify商店中添加实时聊天功能?
Lenovo hybrid cloud Lenovo xcloud, new enterprise IT service portal
How to do a good job of dam safety monitoring
Jenkins continues integration 2
Jenkins继续集成2
学术搜索相关论文
PS effect understanding record 2 color_ dodge color_ burn