Object-oriented concepts:
-----------------------
Object-oriented programming Oop:object oriented programming
Process-oriented Programming ooa:oriented object analyze
Object-oriented design ood:oriented
Object:
Class:
Package: Encapsulation
Inheritance: Inheritance
Polymorphic: Polymorphism
Attribute (member variable):
Behavior (member function):
Heap: Heap
Arrays and objects in the heap
Stack: Stack
Method in the Stack
Member variables:
---------------
Member variables are defined in the class and can be accessed throughout the class.
Member variables are established with the creation of an object and exist in the heap memory where the object resides.
The member variable has a default initialization value of NULL, or you can specify a default value
Local variables:
---------------
Local variables are defined only in local scopes, such as within functions, within statements, and so on.
Local variables exist in the stack memory.
The scope of the action ends, and the variable space is automatically freed.
Local variables do not have default initialization values.
constructor function:
---------------
Characteristics:
The function name is the same as the class name
Do not define return value types
There is no specific return value, and the object is definitely returned after creation.
If the class does not have a constructor defined, the JVM allocates an empty construct.
If the class defines a constructor, there is no empty construct.
Role:
Initializes the object.
Attention:
The characteristics of the default constructor.
Multiple constructors exist in the form of overloading.
Code block:
--------------------
Defined:
The code uses a separate {} enclosing content.
Classification:
To construct a code block:
One of the members of the class
Use a section of code enclosed in {}
When an object is created, it is called before the constructor.
Local code block:
Code blocks defined within a method
Static code block:
Constructs a block with the static decorated code, which is called once when the class is loaded and is no longer called. The initialization process for static member variables is usually placed.
"Java programming" Object oriented OOP (i)