Saturday, August 14, 2010

Single Inheritance

,
Single Inheritance:-In the Single Inheritance there will only one base class and only one derived class.It should be like this.
Example:-
class A
{
A()
{
Cout<<”I m in A”;
}
};
Class B:public A
{
B()
{
Cout<<”I m in B”;
}
};
Voi d main()
{
B b;
}

Output:-I m in A
I m in B

0 comments to “Single Inheritance”

Post a Comment