Created
May 11, 2014 18:07
-
-
Save Fhernd/4cea6c607644282f67ec to your computer and use it in GitHub Desktop.
Demostración de enumeraciones en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ===++=== | |
// | |
// 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