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
Why do we need generics?
Can a constructor be private in c#?
Explain the types of Polymorphism.
Is predicate a functional interface?
What is string programming language?
Why do we use threads in c#?
What is cshtml extension?
What is yield in c#?
Which of the following operations can you not perform on an ado.net dataset?
Describe the parts of assembly.
Is string immutable in c#?
What is a streamwriter in c#?
Is lazy thread safe c#?
What is difference between first and firstordefault?
what are implementation inheritance and interface inheritance?