Interviews - C# Corner

vinod jadhav
Can we inherit an abstract class from another abstract class?
By vinod jadhav in C# onApr 22 2019
  • Amol Bhillare
    May, 2019 24

    Yes, we can inherit the abstract class to another abstract class. See the below example-abstract class A{public virtual void show(){Console.WriteLine("Hello: Base Class!");}}abstract class B : A{public override void show(){Console.WriteLine("Hello: Derived Class!");}}

    • 3
  • Mahesh Alle
    Jul, 2019 22

    Yes, you can. See the below code.

    `public abstract class SavingAccountDetails
    {
    public abstract void PrintData();
    }

    public abstract class CurrentAccountDetails : SavingAccountDetails
    {
    public override void PrintData()
    {
    Console.WriteLine(“Current account details”);
    }
    }`

    • 1
  • Santosh Ingawale
    Jul, 2019 8

    Yes, You can inherit an abstract class from another abstract class.

    • 1
  • Om Pandit
    Jul, 2019 5

    Yes you can inherit abstract class from another abstract class.

    • 1
  • Cindy Nelson
    Sep, 2019 9

    no

    • 0
  • Bidyasagar Mishra
    Aug, 2019 4

    yes, you can

    • 0
  • Priyanka Singh
    Jul, 2019 22

    Sure, an abstract class can inherit from another class!!

    The only time a class cannot inherit from another is when the class you wish to inherit from is sealed or has private constructors only.

    • 0
  • Mahesh Pola
    Jul, 2019 5

    • 0
  • Deepak Rajput
    Jun, 2019 22

    no

    • 0
  • Manisankar Dixit
    May, 2019 15

    Yes you can inherit or extend one abstract class to another abstract class but if the class is a sealed class or single ton class at that time only inheritance cant be applicable.

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS