+ 5
Can an abstract class inherit another abstract class?
If yes then whats the purpose to do so.
2 ответов
+ 8
Yes an abstract class can inherit from another abstract class. What if you want to add more behaviours of different type, other than your base class to your objects. Under such conditions you can use it.
+ 1
abstract class Creature
{
void Exist();
}
abstract class Animal : Creature
{
void Live();
}
class Dog : Animal
{
public void Exist()
{
Console.WriteLine("dog exists") ;
}
public void Live()
{
Console.WriteLine("dog is alive") ;
}
}
}