Module 10 Inheritance, Virtual Functions, and Polymorphism

Chia sẻ: Nguyễn Thị Giỏi | Ngày: | Loại File: PDF | Số trang:41

0
111
lượt xem
19
download

Module 10 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 đủ

In the language of C++, a class that is inherited is called a base class. The class that does the inheriting is called a derived class. Therefore, a derived class is a specialized version of a base class. A derived class inherits all of the members defined by the base class and adds its own, unique elements. C++ implements inheritance by allowing one class to incorporate another class into its declaration. This is done by specifying a base class when a derived class is declared. Let’s begin with a short example that illustrates several of the key features of inheritance....

Chủ đề:
Lưu

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

Đồng bộ tài khoản