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

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