Mid
From PDF
OOP
C# OOP
Can you instantiate an abstract class?
- No, abstract classes cannot be instantiated directly.
- Must be inherited by a derived class which implements abstract methods.
bstract class Shape { public abstract void Draw(); }
// Shape s = new Shape(); // Not allowed
class Circle : Shape { public override void Draw() =>
Console.WriteLine("Circle"); }
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png