首页 > 编程语言 > 详细

(转载)JAVA中八种基本数据类型的默认值

时间:2016-08-12 13:25:06      阅读:145      评论:0      收藏:0      [点我收藏+]

引用

For type byte, the default value is zero, that is, the value of (byte)0. 
For type short, the default value is zero, that is, the value of (short)0. 
For type int, the default value is zero, that is, 0. 
For type long, the default value is zero, that is, 0L. 
For type float, the default value is positive zero, that is, 0.0f. 
For type double, the default value is positive zero, that is, 0.0d. 
For type char, the default value is the null character, that is, ‘\u0000‘. 
For type boolean, the default value is false.

以上摘自《Java Language Specification Second Edition》CHAPTER 4 

基本类型 默认值
byte 0
int 0
short 0
long 0L
float 0.0f
double 0.0d
char ‘\u0000‘
boolean false

(转载)JAVA中八种基本数据类型的默认值

原文:http://www.cnblogs.com/lichmama/p/5764430.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!