Created
August 12, 2019 17:14
-
-
Save parzibyte/fd21299e6fe7f62fc1de053d3719a869 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
/** | |
* Clase en Kotlin | |
* | |
* @author parzibyte | |
* @link https://parzibyte.me/blog | |
* | |
* */ | |
class Mascota(var nombre: String, var edad: Int) { | |
constructor(nombre: String) : this(nombre, 0) { | |
// Opcionalmente aquí el cuerpo u otras acciones | |
} | |
fun dormir() { | |
println("ZZZZ $nombre duerme") | |
} | |
fun saludar() { | |
println("¡Hola! me llamo $nombre y tengo $edad años. Woof") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment