Flashcards
INSY 4306 Ch.11
Cards in this deck (14)
- 1InheritanceAllows a new class to absorb an existing classes members
- 2Direct Base ClassBase class which the derived class explicitly inherits
- 3Indirect Base ClassAny class above the direct base class in the class hierarchy
- 4Class hierarchy begins with classObject
- 5The is-a (a-kind-of) relationship representsinheritance
- 6Base classes are more ______ and derived classes are more _______"more general" and "more specific"
Ex:
Base class is Student
Derived class is Graduate Student or Undergraduate Student - 7A colon (:) followed by a class name at the end of the class declaration header indicates thatthe class extends the class to the right of the colon
- 8Constructors are _____ inheritednot
- 9Method ToStringreturns a string representing an object
- 10To override a base-class method, a derived class must declare a method with keywordoverride
The method must have the same signature (method name, number of parameters and parameter types) and return type as the base-class method. - 11The virtual and abstract keywords indicate thata base-class method can be overridden in derived classes
- 12override modifierDeclares that a derived-class method overrides a virtual or abstract base-class method
- 13Using protected instance variables creates several potential problems.The derived-class object can set an inherited variable’s value directly without validity checking.
Derived-class methods would need to be written to depend on the base class’s data implementation. - 14All classes inherit directly or indirectly from the ______ classobject
Information
- Description
- Flashcards on INSY 4306 Ch.11, created by Christopher Le on 06/11/2015.
- Created by
- Christopher Le
- Views
- 0
- Rating