Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 493 Bytes
namespace DynamicAndDefaultImplementation
{
public interface IRegularPolygon
{
int NumberOfSides { get; }
int SideLength { get; set; }
// Note: These two declarations for GetPerimeter are equivalent:
// a method with default implementation.
//double GetPerimeter()
//{
// return NumberOfSides * SideLength;
//}
double GetPerimeter() => NumberOfSides * SideLength;
double GetArea();
}
}
You can’t perform that action at this time.