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 thread pooling?
what is difference between is and as operators in c#?
Who benefits from ajax?
Is multilevel inheritance possible in c#?
Can we inherit abstract class in c#?
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
Why are strings immutable c#?
What are the desktop applications?
Give an example of a ctype.
What is the namespcae generally given to the webpage of the .NET Framework ?
What is the purpose of c#?
Explain the difference between abstract class and interface.
What is session c#?
What is view state c#?
Why do I get a syntax error when trying to declare a variable called checked?