Home > Back-end >  The concept of polymorphism and abstract class
The concept of polymorphism and abstract class

Time:09-29

Polymorphism is the ability to have multiple state, can use different type name, order number and parameter type, as long as you can, you can also through the method of pure virtual function, upper just give idea, the lower the implementation of the method can go, this is the meaning of the abstract class, hope the great god give criticisms!

CodePudding user response:

Overloading should not polymorphic, overloading is determined at compile time the function of access address, c + + polymorphism is implemented through the virtual function, virtual function allows subclasses redefine member function, and the practice of subclasses redefine the parent class is called cover (override), otherwise known as rewriting, must not pure virtual function, virtual function can be achieved polymorphism
  • Related