Untitled
unknown
plain_text
7 days ago
1.5 kB
4
Indexable
Never
internal class Program { public class Shape { public void draw() { Console.WriteLine("Draw Shape"); } public void erase() { Console.WriteLine("Erase Shape"); } } public class Circle : Shape { public void draw() { Console.WriteLine("Draw Circle"); } public void erase() { Console.WriteLine("Erase Circle"); } } public class Triangle : Shape { void draw() { Console.WriteLine("Draw Triangle"); } public void erase() { Console.WriteLine("Erase Triangle"); } } public class Square : Shape { public void draw() { Console.WriteLine("Draw Square"); } public void erase() { Console.WriteLine("Erase Square"); } } static void Main(string[] args) { Shape shape = new Shape(); shape.draw(); shape.erase(); Circle circle = new Circle(); circle.draw(); circle.erase(); Triangle triangle = new Triangle(); triangle.draw(); triangle.erase(); Square square = new Square(); square.draw(); square.erase(); } }
Leave a Comment