Java data type, java Basic Data Type
I. Java Data Type
1. Basic data type
2. Reference Data Type
Ii. Basic Data Types
1. Integer type: bytr, short, int, long
2. Floating Point Data Types: float and double
3. Character Type: char
4. boolean type: bollean
Type name byte space type description
Byte 1-byte (8-bit) Stores 1-byte data
Short 2-byte (16-bit) Compatibility considerations, generally not used
Int 4-byte (32-bit) Storage INTEGER (commonly used)
Long 8-byte (64-bit) storage of long integers (commonly used)
Float 4-byte (32-bit) storage of Floating Point Numbers
Double 8-byte (64-bit) storage double-precision floating point number
Char 2-byte (16-bit) storage of one byte
Boolean 1-byte (8-bit) Storage logic variable
Step: a. Declare the variable (int I ;)
B. assign values (I = 1;) or ------ int I = 1;
C. Use Variables
A. The default Integer type is int.
B. to define data of the long type, add l or L to the data
C. The default value of the floating point type is double.
D. Define float data. f or F must be added to the data.
E. When double is used, d or D can be added to the backend, which is generally omitted.
F. char indicates the character type. Data should be placed in ''when values are assigned.
* Note: String is not of the data type.