Basic Overview of---variables----
Variable: It is used to store data
Declaration of variables: variable type variable name, variable type---distinguish different types of data, variable name--access variable by name
Variable name (rule): see the meaning of the name, the first letter lowercase after the hump rule
Scope of the variable: within the method/local code block
Variable initialization: The general condition is initialized (the member variable JVM initializes the default)
Classification of---Variables---(java because the JVM exists cross-platform, so the data of various data types occupy the same storage space)
1. Underlying data types
Integral type: byte-1b short-2b char-2b int-4b long-8b
Boolean: Boolean---True/false
Float type: folat-4b double-8b (Precision is distinguished)
2. Reference data types
String (there is a string constant pool if the content is the same as the same string) array of references to various objects--actually storing the address pointing to the object
NOTE: eg int x = 5; At this point 5 is the literal value, the integer default-int floating point number default-double
1. Assigning a small range of values directly to a large range will not compile errors
2. A compilation error occurs when assigning a large range to a small range
3. If you must assign a large range to a small range-mandatory type conversions must be used
A type variable name = (Type a) value;-When the value is changed, the value of the high is discarded to show the low data directly.
The memory allocation process for---variables---
Underlying data type-direct allocation (can be used to determine the size of memory consumed at compile time)--only one piece of memory
Reference data Type--dynamic allocation (unable to determine the size of the occupied memory at compile time)--two blocks of memory (storage object address + object entity)
Underlying data type--stores the value of the variable itself, the reference data type---the address of the object to which it is stored
---operator----
1. Arithmetic operators
2. Logical operators
3. Comparison operators
4. Bitwise operators
6. Operators
7. Three mesh operator
Java Basics Summary-variables, operators summary