Skip to content

Instantly share code, notes, and snippets.

@lfmundim
Created April 27, 2020 23:14
Show Gist options
  • Save lfmundim/1de6ba5645019103f2473d342b45dac8 to your computer and use it in GitHub Desktop.
Save lfmundim/1de6ba5645019103f2473d342b45dac8 to your computer and use it in GitHub Desktop.
// Ran on C# Interactive via VisualStudio
> public abstract class Bird
. {
.     public abstract double GetSpeed();
. }
> public class AfricanBird : Bird
. {
.     public override double GetSpeed()
.     {
.         return 1;
.     }
. }
> public class AmericanBird : Bird
. {
.     public override double GetSpeed()
.     {
.         return 0.7;
.     }
. }
> Bird africanBird = new AfricanBird();
> Bird americanBird = new AmericanBird();
> africanBird.GetSpeed()
1
> americanBird.GetSpeed()
0.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment