Created
August 21, 2022 04:25
-
-
Save jnmontano/46ff1ef8034a7f61e6f28e272d073196 to your computer and use it in GitHub Desktop.
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
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