Abstract class is always a class in my eyes, but unlike other classes, this class can only define the declaration of methods (function declaration, the specific function body or function implementation can also be defined elsewhere. However, an interface only defines a contract. This contract is just a form, and the actual contract process to be implemented is the form of contract (implement ), it needs to be implemented through a specific class. Therefore, an interface is just a convention. It is a data structure that is declared but not implemented.
Second, compared with a common class, an abstract class can be declared or contain specific implemented functions. A common class must contain both declarations and implementations. When using abstract classes, remember the following three points:
1. the abstract class must be [inherited]
2. abstract classes cannot be [sealed]
3. the abstract class cannot be [instantiated], meaning it cannot be new.
For details about the reason why it cannot be sealed, refer to the introduction of the seal class.
First, I posted my post on the 163 blog and copied it to myself.
Http://wanzegui325.blog.163.com/blog/static/3542295201012033937546