CJCoding With Joseph

Chained this And base Constructors

Shape stores Sides. Build Polygon with two constructors: a main one Polygon(int sides, string label) that calls base(sides) and stores the label in a public field Label, and a second one Polygon(int sides) that delegates to the main constructor with this(sides, "polygon"). Do NOT write a Main method.

For new Polygon(3) the program prints:

3
polygon

Expected Output:

3
polygon
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.