Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 11, 2014 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/4cea6c607644282f67ec to your computer and use it in GitHub Desktop.
Save Fhernd/4cea6c607644282f67ec to your computer and use it in GitHub Desktop.
Demostración de enumeraciones en C#.
// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: Ejemplo2Enum.cs
//
// Propósito: Uso de enumeraciones en C#.
//
============================================================*/
using System;
namespace Articulos.Cap03
{
internal class Ejemplo2Enum
{
enum Rango : long
{
Maximo = 21474483648L,
Minimo = 255L
};
public static void Main()
{
// Obtenmos los valores asignados a las constantes:
long x = (long) Rango.Maximo;
long y = (long) Rango.Minimo;
// Valores en pantalla:
Console.WriteLine("Rango.Minimo = {0}", y);
Console.WriteLine("Rango.Maximo = {0}", x);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment