The difference between a member variable and a local variable:
1. Member variables are defined in the class and can be accessed throughout the class. A local variable is defined in a function, statement, local code block, only valid in the area to which it belongs.
2. member variables exist in the object of the heap memory. Local variables exist in the method of stack memory.
3. The member variable exists as the object is created and disappears as the object disappears. Local variables exist with the execution of the owning region and are released as the end of the owning region.
4. member variables have default initialization values. Local variables do not have default initialization values.
Value types pass memory graphs that are passed with reference types:
Encapsulation (encapsulation): Refers to the properties and implementation details of hidden objects, providing public access only externally.
Benefit: Isolate the change. Easy to use. Improve reusability. Improve security.
Encapsulation principle: Hide content that does not need to be provided externally. Hides properties, providing public methods for accessing them.
Private: is a permission modifier that is used to decorate a member. Private content is only valid in this class.
Note: Private is only an embodiment of encapsulation.
The representation of a two-dimensional array in memory:
Java the next day