O'Reilly logo

C# 7 and .NET Core Cookbook by Dirk Strauss

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required