[amp_mcq option1=”child class” option2=”subclass” option3=”derived class” option4=”parent class” correct=”option4″]
The correct answer is: D. parent class
A base class is a class that is used to create other classes. The classes that are created from a base class are called derived classes. The base class is also called the parent class, and the derived classes are called child classes.
A base class can contain members that are common to all of the derived classes. This can save time and effort, because you don’t have to write the same code for each derived class.
For example, let’s say you have a class called Animal. This class could have members such as name, age, and species. You could then create derived classes such as Dog and Cat. These classes would inherit the members of the Animal class, so they would automatically have members such as name, age, and species.
You could then add additional members to the Dog and Cat classes that are specific to those animals. For example, the Dog class could have a member called breed, and the Cat class could have a member called coat_color.
This is just one example of how base classes can be used. They can be used to save time and effort, and to make your code more organized.