Assume the C++ definition : class circle : public point Which of

Assume the C++ definition : class circle : public point Which of
|  Assume the C++ definition : class circle : public point Which of the following is false.?  

A. The colon (:) in the header of class definition indicates inheritance. 

B. All the public and protected members of class 'circle' are inherited as public and protected members , respectively, into class 'point'. 

C. the keyword 'public' indicates type of inheritance. 

D. 'Point' is the base class and 'circle' is the derived class. 

Please scroll down to see the correct answer and solution guide.

Right Answer is: B

SOLUTION

Concept:

Inheritance is the ability of a class to reuse the properties of another class. Class that inherits the properties is known as child class or derived class and another class is known as a base class or parent class.

Explanation:

A derived class can access all the non-private members of the base class. Syntax for inheritance is :

class derived_class: access_specifier base_class

where (:) is used to indicate inheritance.

According to this syntax, options 1, 3, and 4 are correct.

Three access specifiers in c++ are: private, public, and protected.

Public inheritance - In this, public members of the base class become public members of the derived class, and protected members of the base class become protected members of the derived class. 

According to this definition: option 4 is incorrect.

Because according to the given C++ definition, all the public and protected members of class 'point' are inherited as public and protected members, respectively, into class 'circle'.