How to do it...

  1. Create an abstract class called SpaceCadet. This is the first type of astronaut you can get when starting with training. The abstract class and its members are defined using the abstract keyword. A thing to note is that abstract classes cannot be instantiated. The members represent the skills that SpaceCadet will have, such as negotiation and basic weapons training:
        public abstract class SpaceCadet         {           public abstract void ChartingStarMaps();           public abstract void BasicCommunicationSkill();           public abstract void BasicWeaponsTraining();           public abstract void Negotiation();         }
  1. Next, create another abstract class called SpacePrivate. This abstract class inherits from the SpaceCadet abstract class. What we are basically saying ...

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.