java 基本数据类型的默认初始值

java语言中有8中基本数据类型,基本情况如下:

序号

数据类型 大小/位 封装类 默认值 可表示数据范围
1 byte(位) 8 Byte 0 -128~127
2 short(短整型) 16 Short 0 -32768~32767
3 int(整数) 32 Integer 0 -2147483648~2147483647

4

long(长整数)

64

Long

 0L

-9223372036854775808~9223372036854775807

5

float(单精度)

32

Float

0.0f

1.4E-45~3.4028235E38

6

double(双精度)

64

Double

0.0

4.9E-324~1.7976931348623157E308

7

char(字符)

16

Character

'/uoooo'(null)

0~65535

8

boolean

8

Boolean

flase

true或false

转自:

https://blog.csdn.net/strggle_bin/article/details/70194840

表示感谢!!

猜你喜欢

转载自blog.csdn.net/guanmao4322/article/details/85088558