How to do it...

  1. Create a new console application and add a class called SpaceShip to your console application.
        public class SpaceShip         {         }
  1. Our SpaceShip class will contain a few methods that describe the basics of a spaceship. Go ahead and add these methods to your SpaceShip class:
        public class SpaceShip         {           public void ControlBridge()           {           }           public void MedicalBay(int patientCapacity)           {           }           public void EngineRoom(int warpDrives)           {           }           public void CrewQuarters(int crewCapacity)           {           }           public void TeleportationRoom()           {           }         }

Because the SpaceShip class forms part of all other intergalactic vessels, it becomes the blueprint for every other vessel.

  1. Next, we want to create a Destroyer class. To accomplish this, we will create a ...

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.