Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Last active December 19, 2015 05:09
Show Gist options
  • Save Fhernd/5902374 to your computer and use it in GitHub Desktop.
Save Fhernd/5902374 to your computer and use it in GitHub Desktop.
Clase Panda con un miembro estático: Población.
class Panda
{
public string Nombre; // Campo de instancia
public static int Poblacion; // Campo estático
// Constructor
public Panda(string n)
{
Nombre = n; // Asignación al campo de instancia
Poblacion = Poblacion + 1; // Incremento al campo estático Población
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment