Lists are better than arrays. Therefor we want to switch all arrays to lists.1

Step 1

We want to change all appearance of arrays in the Polygon class to List<Point2D>:

  • change the typ of the property and field “Vertices”
  • change the get of “VertexCount”
  • change the constructor
    • we didn’t need the parameter for the vertex count anymore but we need to initialize a empty list instead
  • also change the methods
  1. You can find the solution to this task Here.