There are eight basic data types for Java, each of which corresponds to a reference data type.
Java basic data type: 1) Numeric byte 1 byte range -128--127 (calculation Method -2^ (bytes *8-1)--2^ (bytes *8-1)-1)
Short 2 byte range -2^15--2^15-1
int 4 byte range -2^31--2^31-1
A long 8 byte range -2^63--2^63-1 is usually added with an F when defined
2) Boolean type Boolean 1 bytes True or false is commonly used to determine
3) Float type float 4 bytes is usually defined as adding an F as, float F = 3.15f;
Double 8 bytes Typically use a double to define a floating-point number with high precision
4) Character type char 2 bytes
Java reference data type: Java is an object-oriented programming language, for the objects we define are reference data types, which can be referenced in detail.
Each base type corresponds to a reference data type, Byte>>byte,.... double>>double. Notice where the int>>integer,char>>charater.
Differences between the basic data type and the application data type
The base data type points to a specific value that allocates memory space when the variable is declared, while the reference data type does not allocate space when declared, and the memory space is allocated only when you create the object, and the variable name points to that memory space.
So for
This requires us to pay special attention to creating a basic data type that points to the same value, so it is the same, and the reference data type creates a new object and points the variable to that object, so the value is the same as the object that does not represent the two variables.
Java Learning Codex (3) Java basic data types and reference data types