Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Last active December 25, 2015 05:49
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/6926920 to your computer and use it in GitHub Desktop.
Save Fhernd/6926920 to your computer and use it in GitHub Desktop.
Demostración de herencia y propiedades en C#.
public class Rectangulo : Figura
{
private int ancho;
private int alto;
public Rectangulo (int ancho, int alto, string idFigura) : base (idFigura)
{
this.ancho = ancho;
this.alto = alto;
}
public override double Area
{
get
{
return ancho * alto;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment