6. (A) Implement the concept of method overriding

6. (A) Implement the concept of method overriding
Implement the concept of method overriding



#include<iostream.h>
#include<conio.h>
class BaseClass
{
public:
void Display()
{
cout<<"\n\tThis is Display() method of BaseClass";
}
void Show()
{
cout<<"\n\tThis is Show() method of BaseClass";
}
};
class DerivedClass:public BaseClass
{
public:
void Display()
{
cout<<"\n\tThis is Display() method of DerivedClass";
}
};
void main()
{
clrscr();
DerivedClass Dr;
Dr.Display();
Dr.Show();
getch();
}
6. (A) Implement the concept of method overriding 6. (A) Implement the concept of method overriding Reviewed by admin on December 23, 2019 Rating: 5

No comments:

Powered by Blogger.