// The following is the base's different reference methods for the parent constructor. Using system;
Namespace temp
{
Class Program
{
Static void main (string [] ARGs)
{
Temp2 T = new temp2. (100 );
T. showinfo ();
Console. Readline ();
}
}
Class temp1
{
Public temp1 ()// Base Class constructor without Parameters
{
Console. writeline ("base no paramer ");
}
Public temp1 (INT fo )/ /Base class constructor with Parameters
{
Console. writeline ("base class ");
}
Public Virtual void showinfo ()// Reload-able base class methods
{
Console. writeline ("base method ");
}
}
Class temp2: temp1 // Derived class of temp1
{
Public temp2 ()
: Base (100 )//Call the constructor with parameters of the parent class.
{
Console. writeline ("Child class no paramer ");
}
Public temp2 (INT fo)
: Base ()// Call the constructors without parameters of the parent class.
{
Console. writeline ("Child class ");
}
Public override void showinfo ()// Reload the showinfo method of the parent class
{
Base. showinfo ();
Console. writeline ("This child's method ");
}
}
}