Illustrates the use of an enumeration that defines the orbital periods of the first four planets in days : Enum : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Enum »

 

Illustrates the use of an enumeration that defines the orbital periods of the first four planets in days









    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/
/*
  Example2_11.cs illustrates the use of an enumeration
  that defines the orbital periods of the first four
  planets in days
*/

public class Example2_111
{

  enum PlanetPeriods
  {
    Mercury = 88,
    Venus = 225,
    Earth = 365,
    Mars = 687
  }

  public static void Main()
  {

    System.Console.WriteLine("Orbital period for Mars = " +
      (int) PlanetPeriods.Mars + " days");

  }

}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Enum