Last active
December 19, 2015 05:09
-
-
Save Fhernd/5902374 to your computer and use it in GitHub Desktop.
Clase Panda con un miembro estático: Población.
This file contains hidden or 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
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