Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active February 11, 2019 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/d27cc2710170140d0b14bf02eceb32d7 to your computer and use it in GitHub Desktop.
Save parzibyte/d27cc2710170140d0b14bf02eceb32d7 to your computer and use it in GitHub Desktop.
public class Mascota {
private String nombre;
private int edad;
public Mascota(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;
}
public void ladrar() {
System.out.println(String.format("¡Guau! me llamo %s y tengo %d años", nombre, edad));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment