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 iqueryable in linq?
Write a program to create a user control with name and surname as data members and login as method and also the code to call it. (Hint use event delegates) Practical Example of Passing an Events to delegates
Explain the process of polymorphism with an example?
Can scriptable objects have methods?
Explain what is an interface in c#?
How long has c# been around?
What are the boolean data types in c#?
What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?
Why can’t struct be used instead of class for storing entity?
How to find whether the application is run from inside ide or not?
Is an interface a type c#?
Can the nested class access, the containing class. Give an example?
Can a struct be null?
What are get and set in c#?
What is verbatim string?