Assume the C++ definition : class circle : public point Which of the following…
2017
Assume the C++ definition : class circle : public point Which of the following is false?
- A.
‘Point’ is the base class and ‘circle’ is the derived class.
- B.
The colon (:) in the header of class definition indicates inheritance.
- C.
The keyword ‘public’ indicates type of inheritance.
- D.
All the public and protected members of class ‘circle’ are inherited as public and protected members, respectively, into class ‘point’.
Attempted by 168 students.
Show answer & explanation
Correct answer: D
point is the base class
circle is the derived class
public specifies the type of inheritance
Public and protected members of base class (point) are inherited into the derived class (circle)
Option (d) is false because it reverses inheritance direction, incorrectly stating that members of circle are inherited into point.