Lecture 09: Various Practical Applications of Inheritance in .NET and Analysis of Polymorphism Principles

Original link: https://chenyan98.cn/3656.html

1. The concept of inheritance basic inheritance: understand inheritance from real life, say that inheritance in our life is mainly property, inheritance in our program is mainly code (attributes, methods) By creating a windows form program, observe two Forms, we can find that they all inherit from Form A: What are the requirements and characteristics of code reuse and inheritance in use? Features: Inheritance is transitive! A–>B–>CA will have the related properties and methods of B and C, that is, C will pass the content that is allowed to inherit to its next level. Requirements: Although inheritance can have many layers, inheritance has a single root! That is to say, a class A can inherit from B, but A cannot inherit from C at the same time…. Multiple inheritance is allowed in C++, but not in C# and Java. A–>B,C This […]

This article is reprinted from: https://chenyan98.cn/3656.html
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment