2. C++ inheritance

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

False

(T/F) A derived class receives the private member functions from its base class

true

(T/F) C++ has no interface keyword

True

(T/F) In inheritance, you should always define a destructor in the base class when pointers are being used

Derived class

A derived class is any class that inherits attributes and methods from any other derived class or base class.

Base class

Class that is higher up (less specific) in the inheritance hierarchy

Inheritance

In the object-oriented data model, the ability of an object to inherit the data structure and methods of the classes above it in the class hierarchy. See also class hierarchy.

const_cast

a type conversion that casts the data to a new type, removing the "const" keyword

reinterpret_cast

casts a pointer of one type to a pointer of another; dangerous and allows the user to redefine a data type

narrow_cast

checks for loss in data (ie: int -> float, loss of decimals) and throws a runtime error if that occurs

static cast

converts the expression's value to the indicated type. Ex: If myIntVar is 7, then static_cast<double>(myIntVar) converts int 7 to double 7.0.

virtual

keyword that allows for the overriding of a base class's function by a derived class

override

keyword that tells the compiler to ignore the base class's function and execute the derived class's function instead

interface

shared boundary that contains no data or code; achieved by virtual function with no function bodies, also they can have no member data


संबंधित स्टडी सेट्स

AP Macro Unit 1: Basic Economic concepts

View Set

Quizlet # 8. Ir, tener, tomar, y necesitar.

View Set

3.8.W - Lesson: The Digestive System

View Set

NUR 418 Quizzes and PP Questions for Exam 3

View Set

Maternity & Child Practice Exam 6

View Set