Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created October 10, 2013 23:01
Show Gist options
  • Save Fhernd/6926979 to your computer and use it in GitHub Desktop.
Save Fhernd/6926979 to your computer and use it in GitHub Desktop.
Demostración de herencia y propiedades en C#.
using System;
public class PruebaFigura
{
public static void Main ()
{
Figura[] figuras =
{
new Cuadrado (5, "Cuadrado #1"),
new Circulo (3, "Círculo #1"),
new Rectangulo (4, 5, "Rectángulo #1")
};
Console.WriteLine ("Colección de Figuras");
foreach (Figura figura in figuras)
{
Console.WriteLine (figura);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment