repl.it
@kironroy/

methodoverriding

C#

No description

fork
loading
Files
  • main.cs
  • Canvas.cs
  • main.exe
  • notes.txt
  • Position.cs
  • Shape.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;


namespace MethodOverriding
{
    class Program
    {
        static void Main(string[] args)
        {
            var shapes = new List<Shape>();
            shapes.Add(new Circle());
            shapes.Add(new Rectangle());
            shapes.Add(new Triangle());
            shapes.Add(new Square());
      

            var canvas = new Canvas();
            canvas.DrawShapes(shapes);

            var dinosaurPosition = new Position();
            dinosaurPosition.X = 2;
            dinosaurPosition.Y = 10;

            Console.WriteLine(dinosaurPosition.X);
            Console.WriteLine(dinosaurPosition.Y);

      
        }
    }
}