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 are the types of parameters in c#?
what is the default access for a class
Where do I put dll files?
What is string pool in c#?
What is namespace in oop?
What are the value types in c#?
What are custom exceptions in C#?
How to implement singleton design pattern in c#?
What is IL / CIL / MSIL?
What is uint16?
Can we write class inside a class in c#?
Is class reference type c#?
When would you use generics in your code c#?
What are c# i/o classes? What are the commonly used i/o classes?
Is and as keyword in c# net?