Skip to content

Instantly share code, notes, and snippets.

@jnmontano
Created August 21, 2022 04:25
Show Gist options
  • Save jnmontano/46ff1ef8034a7f61e6f28e272d073196 to your computer and use it in GitHub Desktop.
Save jnmontano/46ff1ef8034a7f61e6f28e272d073196 to your computer and use it in GitHub Desktop.
public class Main {
public static void main(String[] args) {
Persona persona = new Persona();
persona.setEdad(25);
persona.setNombre("Nelson Montaño");
persona.setTelefono(4725127);
System.out.println("Edad --> " + persona.getEdad());
System.out.println("Nombre --> " + persona.getNombre());
System.out.println("Telefono --> " + persona.getTelefono());
}
}
class Persona{
private int edad;
private String nombre;
private int telefono;
public void setEdad(int edad) {
this.edad = edad;
}
public int getEdad() {
return this.edad;
}
public void setNombre(String nombre){
this.nombre = nombre;
}
public String getNombre(){
return this.nombre;
}
public void setTelefono(int telefono){
this.telefono = telefono;
}
public int getTelefono(){
return this.telefono;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment