## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

# I keep getting an error when defining my class asking if I'm defining it as a subclass and if I'm doing that b4 or after

I get the following error: Bummer: Did you define your Square class as an inner class of the Polygon class? Be sure to define the Square class before or after the definition for the Polygon class.

But per the previous example I'm defining the class outside of the Polygon class's {}.

class Polygon {code} class Square : Polygon {code}

I keep going back to the examples and I can't figure out why I get this error.

Additionally, the task requires a "single" parameter for Square that is initialized by the base: call method. However, the parameter for the "Square" is length of the sides and the parameter for "Polygon" is number of sides. These two things are not related mathematically. So, I'm confused. If the number of sides is supposed to be initialized in the base method of Polygon class through the Square class shouldn't there be a parameter for the number of sides?

Polygon.cs
```namespace Treehouse.CodeChallenges
{
class Polygon
{

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

}

class Square : Polygon
{

public Square(int sideLength) : base(NumSides)
{
}

}

}
```

```        public Square(int sideLength) : base(4)    // this puts 4 into NumSides