Which statement best describes the relationship between base class and derived class types?
a. A derived class reference cannot be assigned to a base class variable and a base class
reference cannot be assigned to a derived class variable.
b. A derived class reference can be assigned to a base class variable and a base class
reference can be assigned to a derived class variable.
c. A base class reference can be assigned to a derived class variable, but a derived class
reference cannot be assigned to a base class variable.
d. A derived class reference can be assigned to a base class variable, but a base class reference cannot be assigned to a derived class variable.
d. A derived class reference can be assigned to a base class variable, but a base class reference cannot be assigned to a derived class variable.
You might also like to view...
A(n) ________ is a key that is switched from one setting to another; Caps Lock is an example
Fill in the blank(s) with correct word
Which interface is used to identify classes whose objects can be written to or read from some type of storage or transmitted across a network?
a. Comparable b. Runnable c. AutoCloseable d. Serializable