COIS 1020H Lecture 12: WEEK 12 LEC NOTES

63 views2 pages

Document Summary

Derived class conations data and methods defined in the original class. Polymorphism: using the same method or property bane to indicate different implementations, eg. Although both are vehicles and have an operate() method, a bicycle is operated differently than a truck. Derived class can override and hide methods and data from the base class. Using the object class object( or object) calass type in the system namespace: ultimate base class for all other types, the keyword object is an alias for the system. object class. Calls the constructor for both the base class and the derived class. When a base class constructor requires arguments : include a constructor for each derived class you create. The derived class constructor can contain any number of statements: within the header, provide values for any arguments required by the base class constructor, using the keyword base.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents