int 与 Integer 的区别

2.int的默认值为0,而Integer的默认值为null,即Integer可以区分出未赋值和值为0的区别,int则无法表达出未赋值的情况,例如,要想表达出没有参加考试和考试成绩为0的区别,则只能使用Integer。

原文:http://1790235360.iteye.com/blog/2293811

猜你喜欢

转载自whnqwe.iteye.com/blog/2294171