How to do it...

  1. If you haven't already done so in the previous recipe, create an abstract class called Cat:
        public abstract class Cat         {           public abstract void Eat();           public abstract void Hunt();           public abstract void Sleep();         }
  1. Next, add a class called Cheetah that inherits from the Cat abstract class:
        public class Cheetah : Cat         {         }
  1. As soon as you inherit from the Cat abstract class, Visual Studio will show you a warning via the lightbulb feature. As you inherited from the abstract class Cat, you have to implement the abstract members within the abstract class in your derived class Cheetah:
  1. This is easily fixable by typing ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.