View Java-digit share of each data type, and represents the range of values, and draw conclusions.

java Eight types of basic data types: byte, int, short, long, boolean, char, float, double
Corresponding class: Byte, Int, Short, Long, Boolean, Charecter, Float, Double
Logical: boolean
Text type: char
Integer: byte, short, int, long
Float: float, double
byte : -128 to 127. 1 byte
Short : 2 bytes -2 ^ 15 to 2 ^ 15-1
int  : byte. 4 -2 ^ 31 to 2 ^ 31-1
Long :. 8 bytes -2 ^ 63 to 2 ^ 63-1
Boolean :. 1 byte true false (java can not be replaced by 0 or 0)
a float :. 4 bytes -3.403E38 ~ 3.403E38
Double :. 8 bytes -1.798E308 ~ - 4.9E324
char : 2-byte '\ u0000' ~ '' \ uffff '(16 decimal, i.e. recalculated from 0 to 65535)
(1 byte equals eight bits)
Conclusion: from the basic to the complex.

Tags: bit operating    character    search engine    sign    the WWW    the Java variable    analysis    Integer    code 

Guess you like

Origin www.cnblogs.com/shenaoyu/p/11541241.html