Java Data type diagram:
┏ numeric ━┳━ integer type: byte short int long
┏ basic Data type ━━┫ ┗━ floating-point type: float double
┃ ┣ character type: Char
Data type ╋ ┗ Boolean: Boolean
┃ ┏ Classes (Class)
┗ Reference data Type ━━╋ Interface (interface)
┗ Arrays (Array)
Java data types are divided into basic data types (raw data types) and reference data types;
1. The basic eight categories, can be clearly seen in the figure; This type of data variable is immediately allocated to his memory space after the declaration. such as: short A; Java will look for a two-byte block to the A variable in the available memory space;
2. Reference data type in the three kinds of pointers, such as C + +, which point to the object entity in a special way (the specific value), such variables are not allocated memory when declaring, just store a memory address, want to know exactly what to look at the data structure is good.
Popular speaking, one, remember very enough; two, say the memory, talk about the address is basically refers to the reference rather than the basic; three, you can understand the memory address is your study number, and the object entity is you, every time you find through the study number, this is the reference;
The application of this knowledge point:
1. "= =" function in the reference data type, determine whether the memory address is equal, want to judge the content entity with equals;
2, the basic transmission of the value of the transfer is a copy, the original value is unchanged after the change, the reference value of the pass-through is the address, modified the original value changes.
Basic data types and reference data types for Java