Object-oriented programming is to encapsulate the operation of data and data into an indivisible whole, and abstract objects with the same characteristics into a new type of data-class. The entire system is run through message passing between objects. Provides an effective way to reuse code through the inheritance of object classes.
Difference:
In the object-oriented programming method, its program structure is a collection of classes and various types of structures that are associated with inheritance relationships. There is a main program that defines objects in the main program and prescribes the law of passing messages between them.
Object: The core of object-oriented technology. All object-oriented programs are composed of objects that are first self-governing, self-satisfying (he can manage himself through his own defined actions), and they can communicate, coordinate and cooperate with each other, thus accomplishing the whole program's characters and functions together.
Class: Is the collection and abstraction of the same object. A class is an abstract data type, which is an abstraction of all objects with a certain commonality, whereas an object belonging to a class is called an instance of the class, and is the result of a class instantiation.
The state and behavior of the object:
Objects have state and behavior.
The state of an object, also known as the static property of an object, mainly refers to the various information contained within the object, that is, variables. Each object individual has its own proprietary internal variables that indicate the state in which the object is located. When an object undergoes a state change in a certain operation and behavior, it concretely reflects the change of the content of the variable. By examining the contents of the object's property variables, you can see what state the object is currently in.
Behavior is also called the operation of the object it mainly describes the dynamic properties of the object, the action is to set or change the state of the object. An object's operations are generally based on variables inside the object and attempting to change those variables (and change the state of the object)
Difference:
The state of an object is represented inside the computer by a variable, and the behavior of the object is represented inside the computer by means of a method.
(methods are similar to procedures-oriented functions.) The behavior or operation of an object is defined inside its method. )
My java--object-oriented programming