Define multiple inheritance. Give example.
Multiple Inheritance: When a single class is derived from more than one base class then it is known as multiple inheritance. A derived class can inherit the attributes of all base classes from which it is derived.
Syntax:
class Test
{
};
class Sports
{
};
class Result:publicTest,public Sports
{
};
In the above example class „Result‟ is a single derived class derived from two base classes base class „Test‟ and base class „Sports‟.