#include <iostream>
#pragma hdrstop
using
std::cout;
using
std::endl;
//---------------------------------------------------------------------------
#pragma argsused
//---------------------------------------------------------------------------
class
Base {
public
:
Base() { };
virtual
void
DisplayMessage() {
cout <<
"Displaying Message from an object of Base class"
<< endl;
};
};
//---------------------------------------------------------------------------
class
DerivedFirst :
public
Base {
public
:
DerivedFirst() { };
void
DisplayMessage() {
cout <<
"Displaying Message from an object of DerivedFirst class"
<< endl;
}
};
//---------------------------------------------------------------------------
class
DerivedSecond :
public
Base {
public
:
DerivedSecond() { };
|