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