Java basic data types

1.

1Byte=8Bit (one byte equals eight bits)

 Maximum value: MAX_VALUE= 2 7 -1. (127)

 Minimum value: MIN_VALUE= -2 7 . (-128) 

2.

short two bytes 16 bits

Min: Short.MIN_VALUE=-32768 (-2 15 )
Max: Short.MAX_VALUE=32767 (2 15 -1)

3.

int four bytes 32 bits

Min: Integer.MIN_VALUE= -2147483648 (-2 31 )
Max: Integer.MAX_VALUE= 2147483647 (2 31 -1)

4.

long eight bytes 64 bits

Minimum value: Long.MIN_VALUE=-9223372036854775808 (-2 63 )
Maximum value: Long.MAX_VALUE=9223372036854775807 (2 63 -1)

5.

double eight bytes 64 bits

6.

float four bytes 32 bits

7.

char two bytes 16 bits

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325331118&siteId=291194637