Can we inherit an abstract class in another abstract class.
If no why and If yes how..?
Answer Posted / anonymous
Yes we can Inherit abstract class into another abstract
class just like we inherit any other class. Since the
Inheriting class is also an Abstract class so there is also
no need to override the parent class methods.
Example:
namespace AbstractNamespace
{
public class AbstractClass1 //Parent Abstract Class
{
public abstract string MyFunction1();
}
public class AbstractClass2 : AbstractClass1 //Child
Abstract Class
{
public abstract string MyFunction2();
}
public class TestAbstractClasses : AbstractClass2
{
//Here you will need to override both the functions
//MyFunction1() and MyFunction2()
}
}
Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
What is threading in c# with example?
What is difference between continue and break in c#?
What is tuple in c#?
What is object array in c#?
Why singleton pattern is used in c#?
What is difference between class and abstract class in c#?
Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?
Is boxing an implicit conversion?
Can you store strings in arrays?
When a Static Constructor is called in a Class?
What is a generic in c#?
What is access modifier in c#?
What is an int in c#?
Distinguish between system.string and system.text.stringbuilder classes?
what is an exception in .net?