/*
Syntax For Inheritence
======================
class DerivedClassName:accessspecifier BaseClassName
{
}
*/
#include<iostream.h>
#include<conio.h>
class Base
{
public:
void BaseClass()
{
cout<<"\n I am Base Class";
}
};
class Derived:public Base
{
public:
void BaseClass()
{
cout<<"\n I am Derived Class";
}
};
main()
{
Derived d;
clrscr();
d.BaseClass();
d.Base::BaseClass();
getch();
}
Syntax For Inheritence
======================
class DerivedClassName:accessspecifier BaseClassName
{
}
*/
#include<iostream.h>
#include<conio.h>
class Base
{
public:
void BaseClass()
{
cout<<"\n I am Base Class";
}
};
class Derived:public Base
{
public:
void BaseClass()
{
cout<<"\n I am Derived Class";
}
};
main()
{
Derived d;
clrscr();
d.BaseClass();
d.Base::BaseClass();
getch();
}
No comments:
Post a Comment