C # three features of object-oriented programming:
- Encapsulation
- Inheritance
- Polymorphism
1. Encapsulation
The interaction and interaction process between objects are mainly achieved through the message mechanism. Objects do not need to be too familiar with the specific status or motion rules of the other party. Object-oriented classes are well-encapsulated modules. class definitions display their descriptions (User-visible external interfaces) and implementations (User-invisible internal implementations) separately, its internal implementation provides protection according to its specific scope.Class is the most basic unit of encapsulation.
2. Inheritance
Inheritance is the process of creating a new class for an existing class. The existing class is called the parent class, and the new class is called the subclass. The subclass can access the attributes and methods of the parent class.
3. Polymorphism
Polymorphism means that methods with the same name can have different running rules in different classes.
The following is a C # Object-Oriented Programming thought map of encapsulation, inheritance, and polymorphism. For full screen viewing, click: