Computer Science, asked by fenilsutariya45, 4 months ago

1. Write a program to create two classes which contain one value each. Create a function sum() to perform multiplication of both values using single inheritance.​

Answers

Answered by Anonymous
1

Answer:

Consider a group of vehicles. You need to create classes for Bus, Car and Truck. The methods fuelAmount(), capacity(), applyBrakes() will be same for all of the three classes. If we create these classes avoiding inheritance then we have to write all of these functions in each of the three classes as shown in below figure:

inheritance

Answered by RehanAk73
1

Answer:

Explanation:

Multiple Inheritance is a feature of C++ where a class can inherit from more than one classes. The constructors of inherited classes are called in the same order in which they are inherited. For example, in the following program, B's constructor is called before A's constructor.

Similar questions