Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 1
protocol Hablar {
func decirHola(nombre: String)
}
// 2
class Persona: Hablar {
// 3
func decirHola(nombre: String) {
// 4
print("Hola (nombre).")
}
}
// 5
var juliana = Persona()
var geykel = Persona()
// 6
juliana.decirHola("Geykel")
geykel.decirHola("Juliana")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment