Objects have properties and actions, such as people and the height of fat and thin properties, and walking, jumping and other actions. Object-oriented programming we are using this object, we just need to understand this method in use, the specific method of implementation of some of the details do not need us to know. Like driving, we know that stepping on the accelerator is accelerating, As for the principle of stepping on the accelerator, we don't need to know, because we're not learning machinery. So when we call the method of the object, we know what arguments go in, and then return what results to us.
There are three main features of object-oriented
1. Encapsulation
To encapsulate some of the implementation details, such as when we use a computer, we move the mouse, hit the keyboard, we can achieve the desired effect, but the specific implementation of the part has been encapsulated, do not need us to understand.
2. Inheritance
The function of the parent class is also inherited, which can increase the reusability of the code.
3. polymorphic
If you use interfaces and abstract classes to make reference types, when objects inherit abstract classes or implement interfaces. Then this object is equivalent to a variety of forms. When the implementation class changes, you only need to modify the implementation class, the other code will not need to modify,
If you use factory-produced objects, you only need to modify the method of the factory class, and the code for this class does not need to be modified. It's like helicopters and civil aircraft are planes, they all have take-off action, so you can add a takeoff method on the interface plane. When the aircraft type is changed, There is no need to modify the method that calls the plane to take off.
How Java understands object-oriented