Essential C# Inheritance  Suggest an edit

Inheriting from a class and implementing an interface

public class Animal 
{
    public string Name { get; set; }
}

public interface INoiseMaker
{
    string MakeNoise();
}

//Note that in C#, the base class name must come before the interface names
public class Cat : Animal, INoiseMaker
{
    public Cat() 
    {
        Name = "Cat";
    }

    public string MakeNoise()
    {
        return "Nyan";
    }
}

Table Of Contents
22 Enum
25 GUID
57 Inheritance
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close