int和Integer的区别?包装类?装箱?拆箱?

int和Integer的区别:

1) int是基本数据类型,直接存储的数值,默认是0;

2) Integer 是int的包装类,是个对象,存放的是对象的引用,必须实例化之后才能使用,默认是null;

包装类?装箱拆箱?

菜鸟教程 -- https://www.runoob.com/java/java-number.html

posted @ 2020-02-02 11:17  JustJavaIt  阅读(174)  评论(0编辑  收藏  举报