Hi,
IF i am not wrong , it is not compulsory that the abstract methods inside an abstract class must be implemented in the derviedclass.
whereas it is a must in the case of interfaces.
using System;
abstract class abssample
{
public abstract void ABM();
// public abstract void disp(); -- >displays an error if i donot implement this in the dervied class.
public void DisplayMsg()
{
Console.WriteLine(" I am a non Abstract Method inside an abstract class");
}
public virtual void ViM()
{
Console.WriteLine("Virtual Method inside the asbtract class");
}
}
class D : abssample
{
public override void ABM()
{
Console.WriteLine("Abstract Method of an abstract class - abssample");
}
public override void ViM()
{
Console.WriteLine("Virtual Method of an abstract class");
}
}
class test
{
static void Main()
{
D dobj = new D();
dobj.ABM();
dobj.DisplayMsg();
dobj.ViM();
}
}