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


Please Help Members By Posting Answers For Below Questions

What does out mean c#?

582


What is session management in c#?

628


Is php easier than c#?

583


What is hashtable in c# with example?

573


Can I fly with a loop recorder?

554






Is it possible to inherit multiple interfaces?

620


What are the properties in c#?

578


What is the purpose of private constructor in c#?

650


What are the steps to create an assembly and add it to the gac?

541


Can you instantiate an abstract class c#?

576


What is entity framework c#?

541


What is the difference between string keyword and system.string class?

599


What is state c#?

529


Is php better than c#?

580


Explain boxing and unboxing in c#?

593