Skip to content

Instantly share code, notes, and snippets.

@dimitris-papadimitriou-chr
Created July 10, 2020 03:54
Show Gist options
  • Select an option

  • Save dimitris-papadimitriou-chr/68d59c8aebc926e3aa44eac45c513095 to your computer and use it in GitHub Desktop.

Select an option

Save dimitris-papadimitriou-chr/68d59c8aebc926e3aa44eac45c513095 to your computer and use it in GitHub Desktop.
abstract class Shape
{
public abstract string GetShapeDescription();
}
class Rectangle : Shape
{
public int Width { get; set; }
public int Height { get; set; }
public override string GetShapeDescription()
{
return $"Found { Height }x { Width} rectangle";
}
}
class Circle : Shape
{
public int Radius { get; set; }
public override string GetShapeDescription()
{
return $"found a circle with radius { Radius}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment