MCQs
None.
None.
We are passing the objects and executing them in a certain order and we are printing the program flow.
Output:
$ g++ des3.cpp
$ a.out
123
In this program, We are passing the values from the main class and printing it on the inherited classes.
Output:
$ g++ des2.cpp
$ a.out
1020
In multiple inheritance, We are able to derive a class from more than one base class.
In this program, We are multiplying the value 10 and 4 by using inheritance.
Output:
$ g++ des.cpp
$ a.out
40
There are three types of classes. They are abstract base classes, concrete derived classes,
standalone classes.
None.
Class hierarchies promote reuse in two ways. They are code sharing and interface sharing.
If we invoked the interface as public means, We can access the program from other programs also.