C# C# Objects Inheritance Inheritance

Cem Karasu
Cem Karasu
489 Points

i couldnt do it please can someone help me

how can i use base class on this example

Polygon.cs
namespace Treehouse.CodeChallenges
{
    class Polygon
    {
        public readonly int NumSides;
        public readonly int SideLength;

        public Polygon(int numSides)
        {
            NumSides = numSides;
        }
        public Square
    }
}

1 Answer

Steven Parker
Steven Parker
177,536 Points

First off, don't make any changes to the "Polygon" class. When you create "Square", it should be a new class. It will be in the same namespace but it will not be inside "Polygon".

You'll need to reference the base class in both the declaration and the constructor. You might want to take another look at the first two videos of this stage because you can see examples of how this is done there.