CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Which of the following do you think is used to separate the base classes in a base class list?

A
Comma(,)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
CoIon(:)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Semi-colon(;)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Tilde (~)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is D Comma(,)

Comma(,) is used to separate the base classes in a base class list.

Inheritance allows us to define a class in terms of another class, which makes it easier to create and maintain an application. Inheritance, involves a base class and a derived, separated by commas, in the list of a class's base classes.

Any class type may be declared as derived from one or more base classes which, in turn, may be derived from their own base classes, forming an inheritance hierarchy. The base-clause consists of the character:followed by a comma-separated list of one or more base-specifiers.

When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of an existing class. This existing class is called the base class, and the new class is referred to as the derived class.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Process Of Recombinant DNA Technology
BIOLOGY
Watch in App
Join BYJU'S Learning Program
CrossIcon