Created
August 31, 2014 15:45
-
-
Save Fhernd/74218e4f78e787307c86 to your computer and use it in GitHub Desktop.
La clase estudiante hereda de la clase `Persona` (https://gist.github.com/Fhernd/f636900a501289597616).
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
using System; | |
namespace Articulos.Preguntas.P0420 | |
{ | |
public class Estudiante : Persona | |
{ | |
private String carnet; | |
public String Carnet | |
{ | |
get | |
{ | |
return carnet; | |
} | |
set | |
{ | |
carnet = value; | |
} | |
} | |
// Constructor de `Estudiante` que invoca al constructor | |
// de la clase base `Persona`: | |
public Estudiante (string nombreEstudiante, string carnetEstudiante) | |
: base (nombreEstudiante) | |
{ | |
carnet = carnetEstudiante; | |
} | |
public static void Main() | |
{ | |
Estudiante estudiante = new Estudiante("John Learner", "201311620"); | |
Console.WriteLine ("\nNombre del estudiante: {0}", estudiante.Nombre); | |
Console.WriteLine ("Carnet del estudiante: {0}\n", estudiante.Carnet); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment