Computer Science 1037A/B Lecture Notes - Lecture 32: Enumerated Type, Multiple Inheritance

26 views3 pages

Document Summary

Practice of passing on property, titles, liabilities etc. from one to the other. For classes, it will be member variables, member functions etc. Inheritance: way of creating a new class by starting with an existing class and adding new members. The new class can replace or extend the functionality of the existing class. When an object (instance of new class) is a specialized version of one object (instance of existing class) The specialized object has all of the characteristics of the general object, plus additional characteristics that make it special. // derived class class derived : public base. Parent class class parent public: int a; void bf(); Child class class child : public parent int c; void df(); int a; void bf(); int c; void df(); #include using namespace std; inheritance. h enum discipline { archeology, biology, computer_science }; enum classification { freshman, sophomore, junior, senior }; class person private: string name; public:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents