Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * @author Jesús Darío Rodríguez
- */
- public class Estudiante extends Persona{ //indica que hereda de la clase persona
- private String matricula;
- private int semestre;
- public Estudiante(String nombre, String apellidos, int edad) { //metodo constructor
- super(nombre, apellidos, edad); //llamando a los atributos de la clase padre
- }
- public String getMatricula() { //geter
- return matricula;
- }
- public int getSemestre() { //getter
- return semestre;
- }
- public void setMatricula(String matricula) {
- this.matricula = matricula; //setter
- }
- public void setSemestre(int semestre) { //seter
- this.semestre = semestre;
- }
- public void mostrarNombreApellido(){
- System.out.println("Nombre del estudiante:"+getNombre()+"\nApellidos del Estudiante:"+getApellidos()+"\nEdad del Estudiante:"+getEdad()+"\nMatricula:"+getMatricula()+"\nSemestre:"+getSemestre());
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement