-
-
Save javautodidacta/e836c7d0b1b106819fe63efe7f530a33 to your computer and use it in GitHub Desktop.
Esta clase crea un objeto de tipo Persona con nombre y edad.
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
package es.javautodidacta; | |
/** | |
* This class creates a {@code Persona} object. | |
* | |
* @author Miguel Callejón Berenguer | |
* @version 2018.02 | |
*/ | |
public class Persona { | |
private String nombre; | |
private int edad; | |
public Persona(String nombre, int edad) { | |
this.nombre = nombre; | |
this.edad = edad; | |
} | |
public String getNombre() { | |
return nombre; | |
} | |
public void setNombre(String nombre) { | |
this.nombre = nombre; | |
} | |
public int getEdad() { | |
return edad; | |
} | |
public void setEdad(int edad) { | |
this.edad = edad; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment