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 is threading in c# with example?

456


What is difference between continue and break in c#?

481


What is tuple in c#?

532


What is object array in c#?

514


Why singleton pattern is used in c#?

535






What is difference between class and abstract class in c#?

461


Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?

553


Is boxing an implicit conversion?

545


Can you store strings in arrays?

542


When a Static Constructor is called in a Class?

586


What is a generic in c#?

509


What is access modifier in c#?

496


What is an int in c#?

525


Distinguish between system.string and system.text.stringbuilder classes?

444


what is an exception in .net?

518