Feedback for these lessons is very much welcome. If you like or hate something about a lesson let us know, either on GitHub, via Mail or just tell us in person ;)
x
A09 - Lists for Shapes
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