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 the usage of Enumeration in C# Programming and is it good to use or not ?
What is the purpose of c#?
What is .dbml file?
What are the advantages of using c#?
What is code verification?
Define xslt.
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
Why do we need abstraction in c#?
What is datetime minvalue in c#?
What is the difference between static and private constructor?
Is int an object in c#?
Are objects passed by reference in c#?
What is delegates and events?
Is there throws keyword in c#?
Explain Constructor and destructor?