Polymorphism in C++

后端 未结 7 1068
甜味超标
甜味超标 2020-11-22 09:01

AFAIK:

C++ provides three different types of polymorphism.

  • Virtual functions
  • Function name overloading
  • Operator overloading
7条回答
  •  借酒劲吻你
    2020-11-22 09:36

    Polymorphism means many forms as such it is used for an operator to act differently under different instances. Polymorphism is used to implement inheritance. For ex, we have defined a fn draw () for a class shape then the draw fn can be implemented for drawing circle, box, triangle and other shapes. ( which are objects of the class shape)

提交回复
热议问题