基本数据类型和引用数据类型

(1)基本数据类型

①数值型

㈠整数类型 byte short int long

㈡浮点类型 float double

②字符型 char

③布尔型 boolean

(2)引用数据类型

①类 class

②接口 interface

③数组

 

NO.

数据类型

大小/位

可表示范围

默认值

1

byte(字节)

8

-128~127

0

2

short(短整型)

16

-32768~32767

0

3

int(整型)

32

-2147483648~2147483647

0

4

long(长整型)

64

-9223372036854775808~9223372036854775807

0

5

float(单精度)

32

-3.4E38~3.4E38

0.0

6

double(双精度)

64

-1.7E308~1.7E308

0.0

7

char(字符)

16

0~255

‘u0000’

8

boolean(布尔)

-

true 或 false

false

原文地址:https://www.cnblogs.com/zyn0216/p/7606010.html