C # class (7) - Abstract Abstract

Abstract

Abstract, keywords Abstract, the most typical application is in the inheritance mechanism in a baseclass, an abstract class can not be instantiated (in front of that static class can not be instantiated)
it must be used as the base class, inherited by others, then you must instantiate the derived class can use the abstract class members

Scenarios, may not be too much. In most cases, he was more of a description of a concept, rather than specific to the kind.

Here we have an abstract 4条腿的动物class, and then let the Dog inherit it, and, like the previous chapter, after we instantiate abstract class can call the Dog in the Describe () method


Ditto a different, Dog after inheriting an abstract class methods can be reconstructed, the samevirtual override base

Guess you like

Origin www.cnblogs.com/springbrotherhpu/p/11541487.html