Ask Question
28 August, 20:15

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. 28 August, 23:36
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers