Ajeet  Malviya

Ajeet Malviya

  • NA
  • 126
  • 15.8k

How to call base abstract class virtual method ?

Jul 20 2017 5:56 AM
namespace ExcelCopy
{
public class Program : Abs
{
static void Main(string[] args)
{
Program p = new Program();
p.NonAbstract();
Abs a = new Program();
a.NonAbstract();
}
public override void GetFullName()
{
throw new NotImplementedException();
}
public override void NonAbstract()
{
Console.WriteLine("I am method five from child class, I have my own implimentation");
}
}
public abstract class Abs
{
public abstract void GetFullName();
public virtual void NonAbstract()
{
Console.WriteLine("Hi i ma non abstract method from abstract class");
}
}
}

Answers (3)