Skip to content

Instantly share code, notes, and snippets.

@xray
Last active June 7, 2019 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xray/98403e02bc26132fb54f608b38f6093b to your computer and use it in GitHub Desktop.
Save xray/98403e02bc26132fb54f608b38f6093b to your computer and use it in GitHub Desktop.
An example of inheritance in C#
using System;
public class Dog
{
public void Bark()
{
Console.WriteLine("Woof");
}
}
public class BassetHound : Dog
{
public void Smell()
{
Console.WriteLine("Sniff sniff...");
}
}
var flash = new Hound();
flash.Bark();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment