1. Object-oriented oriented
Object-oriented is relative to process-oriented
Object-oriented and process-oriented are a kind of thought
Process-oriented emphasis is on functional behavior
Object-oriented encapsulates functionality into objects, emphasizing the objects with functionality.
Object-oriented is a process-oriented
Object-oriented Features: 1. Encapsulation 2. Inheritance 3. Polymorphism
Class: Classes are abstractions of objects, software abstractions of things in the real world.
Object: An instance of the class.
Instance: An instance is an object.
2. Functions
A function is a separate applet defined in a class that has a specific function, also called a method.
The format of the function:
Modifier returns a value type function name (parameter type form parameter 1, parameter type parameter 2, ...)
{
Execute the statement;
return value;
}
Return value type: The data type of the result after the function is run.
Parameter type: is the data type of the formal parameter.
Formal parameter: is a variable that stores the actual arguments passed to the function when the function is called.
Actual parameter: The specific value passed to the formal parameter.
return: Used to end the function.
Return value: The result of the function operation, which is returned to the caller
Problems encountered:
For functions, the use of classes in program code is not yet very skilled.
"DAY3" Java object-oriented and function