#include<iostream.h>
class PureVirtual
{
public:
virtual void PDemo()=0;
virtual void NDemo(){};
};
class PureDef:public PureVirtual
{
public:
void PDemo()
{
cout<<"\n Pure Virtual Demo";
}
void NDemo()
{
cout<<"\n Null Virtual Demo";
}
};
void main()
{
PureDef PD;
PD.PDemo();
PD.NDemo();
}
class PureVirtual
{
public:
virtual void PDemo()=0;
virtual void NDemo(){};
};
class PureDef:public PureVirtual
{
public:
void PDemo()
{
cout<<"\n Pure Virtual Demo";
}
void NDemo()
{
cout<<"\n Null Virtual Demo";
}
};
void main()
{
PureDef PD;
PD.PDemo();
PD.NDemo();
}
No comments:
Post a Comment