Inheritance, Virtual Functions, and Polymorphism

Chia sẻ: Chankinh1 Chankinh1 | Ngày: | Loại File: PDF | Số trang:41

0
105
lượt xem
6
download

Inheritance, Virtual Functions, and Polymorphism

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

This module discusses three features of C++ that directly relate to object-oriented programming: inheritance, virtual functions, and polymorphism. Inheritance is the feature that allows one class to inherit the characteristics of another. Using inheritance, you can create a general class that defines traits common to a set of related items. This class can then be inherited by other, more specific classes, each adding those things that are unique to it. Built on the foundation of inheritance is the virtual function. The virtual function supports polymorphism, the “one interface, multiple methods” philosophy of object-oriented programming. ...

Chủ đề:
Lưu

Nội dung Text: Inheritance, Virtual Functions, and Polymorphism

Đồng bộ tài khoản