(i) Memory allocation:
Stack data structure: Used to hold local variable values, including:
① basic data types;
② reference data type;
It should be noted that:
The base data type is stored in the stack as the actual value of the variable,
The reference data type holds the first address it points to to hold the value in heap memory.
2. Heap: Used to store dynamically generated data example: New object, heap only save properties, not save method;
3. Constant pool: An ordered collection of constants used to maintain each class.
The constants in the heap and stack are also stored in the corresponding location of their values or reference addresses;
4. When the reference type is compared with "= =", the reference address is compared.
(ii) identifiers
1. Definition: The so-called identifier is the user-defined class name in Java, the method name,
Field name, variable name, package name, and so on.
2. Identifiers Define rules:
The ① identifier cannot be a keyword or a reserved word;
② identifiers can contain letters, numbers, underscores, dollar sign $;
The beginning of the ③ identifier cannot be a number;
④ identifiers are strictly case-sensitive, but do not specify the maximum length of identifiers;
3. Common naming methods:
① Hump nomenclature: All initial letters are capitalized as: class name;
② Pascal nomenclature: First lowercase, other first letters capitalized. such as variable name, method name;
(c) polymorphic
1. Classification:
① static polymorphism: The way of implementation is the overloading of the method;
② Dynamic polymorphism: The way to implement is to rewrite the parent class;
Note: We are talking about polymorphism, which is generally referred to as dynamic polymorphism.
2. Transformation of reference data (the same syntax as the basic Data Transformation):
① upward Transformation: from sub-class to the parent class, can be automatically implemented;
② downward transformation: From the parent class to the sub-class, need to cast;
3. Instantof Keywords:
An instance of the object that is used to determine whether the object before Instantof is Instantof. (Is return true, not return false)
Special mind Points of knowledge