The data types in Java are divided into basic data types and reference data types, basically branching structure as follows:
Java Data type:
Basic data type:
Numeric type:
Integer type: Byte:8 bit, data range -128~127, wrapper class: Java.lang.Byte
Short:16 bit, data range -32768~32767, wrapper class: Java.lang.Short
Int:32 bit, data range (negative 2 of 31 square to positive 2 of 31 times minus 1), Packing class: Java.lang.Integer
long:64 bit, data range (negative 2 of 64 square to positive 2 of 64 times minus 1), Packing class: Java.lang.Long
Floating-point type: float:32 bit, data Range ( ieeee 754 single precision ), Wrapper class: Java.lang.Float, the direct assignment must be preceded by a number F or F, the default value is 0.0f/f
double:64 bit, data range ( max. IEEE 754 Double precision ), wrapper class: Java.lang.Double, can be added D or D when assigned, and can not be added, default value 0.0
Non-numeric type:
Character type: char:16 bit, storing Unicode code, assigning value with single quotation mark, wrapper class: Java.lang.Character, when the variable is initialized, the default value is ' u0000 '
Boolean type: Boolean:1 bit, only true and false two states, initialized to False
Reference data type:
Class, interface, array, enumeration,
Data types in Java