-
-
Save parzibyte/d27cc2710170140d0b14bf02eceb32d7 to your computer and use it in GitHub Desktop.
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
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