Yes you can inherit an abstract class from another abstract class
namespace ConsoleApplication9
{
abstract class A
{
public abstract void Method();
}
abstract class B:A
{
public abstract void MethodB();
}
class C:B
{
public override void Method()
{
Console.WriteLine("A");
}
public override void MethodB()
{
Console.WriteLine("B");
}
}
class Program
{
static void Main(string[] args)
{
C obj = new C();
obj.Method();
obj.MethodB();
Console.ReadLine();
}
}
}
namespace ConsoleApplication9
{
abstract class A
{
public abstract void Method();
}
abstract class B:A
{
public abstract void MethodB();
}
class C:B
{
public override void Method()
{
Console.WriteLine("A");
}
public override void MethodB()
{
Console.WriteLine("B");
}
}
class Program
{
static void Main(string[] args)
{
C obj = new C();
obj.Method();
obj.MethodB();
Console.ReadLine();
}
}
}
No comments :
Post a Comment