oop Object-Oriented-Programming

Title: Object Oriented:

More abstract, examples are needed. For example, for an object, the water cup has attributes such as size, shape, color, material, etc. You only need to know the water cup

The three characteristics are: encapsulation, inheritance, polymorphism

Package:

Encapsulate the attributes of the object together, such as the color, size, material and other attributes of a water cup

inherit:

Subclasses can inherit the methods or properties of the parent class and do not need to be rewritten again

Polymorphism: rewriting and overloading

Rewrite: The subclass inherits the parent class method, you can rewrite the logic, or you can use the logic
overload of the parent class : the same method name, different formal parameters (different parameter types, different numbers of formal parameters, and order of formal parameters) different)

Guess you like

Origin blog.csdn.net/android123ios/article/details/106858386