Ask Question

In the following statement:

class Car : protected Vehicle

Which is the derived class?

A.

Car

B.

Vehicle

C.

protected

D.

cannot be determined

+3
Answers (1)
  1. 25 June, 06:29
    0
    Answer: A. Car

    Explanation:

    Here the base class member is being protected which is Vehicle. The base class is the Vehicle class and the derived class is Car class.

    As the derived class is created or derived from another existing class. So here the class Car has been created through the process of inheritance from the base class which is vehicle. All the methods and variables in Vehicle class are in protected so the only the derived class is able to get access to those variables and methods.

    class Car : protected Vehicle

    The class Vehicle has been defined earlier and the class Car is created.

    The left side is for derived and right side is for base class.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “In the following statement: class Car : protected Vehicle Which is the derived class? A. Car B. Vehicle C. protected D. cannot be determined ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers