How to do it...

  1. Create a new console application in Visual Studio and call it ClassesAndGenerics
  1. Add an abstract class called Cat. To do this, add the abstract keyword to the class. We are now ready to describe the Cat abstract class:
        public abstract class Cat        {        }
The abstract keyword indicates to us that the object it is applied to has no implementation. When used in a class declaration, it basically tells the compiler that the class is to be used as a base class. This means that no instance of the class can be created. The only way in which implementation of the abstract class happens is when it is implemented by derived classes that inherit from the base class.
  1. Your console application code should now look as follows:
 class ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.