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

Why do we need generics?

513


Can a constructor be private in c#?

479


Explain the types of Polymorphism.

581


Is predicate a functional interface?

480


What is string programming language?

439






Why do we use threads in c#?

510


What is cshtml extension?

516


What is yield in c#?

495


Which of the following operations can you not perform on an ado.net dataset?

510


Describe the parts of assembly.

522


Is string immutable in c#?

568


What is a streamwriter in c#?

504


Is lazy thread safe c#?

503


What is difference between first and firstordefault?

489


what are implementation inheritance and interface inheritance?

512