Use base keyword to call base class virtual function

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 704
using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Data.SqlClient;
namespace BlogProject
{
class BaseClass
{
public virtual void Print()
{
Console.WriteLine("I am base print");
}
}
class DeriveClass : BaseClass
{
public override void Print()
{
base.Print();
}
}
class Program
{
static void Main(string[] args)
{
DeriveClass d = new DeriveClass();
d.Print();

Console.ReadLine();
}
}
}

Comments or Responses

Login to post response