Slide 94
Slide 94 text
fun createDog(name: String = “unknown”,
breed: String = “unknown”) {}
createDog(“Fifi”, “Yorkshire Terrier”)
createDog(breed = “Yorkshire Terrier”)
createDog()
public void createDog(String name,
String breed) {}
public void createDog(String breed) {
String name = “unknown”
}
public void createDog() {
String name = “unknown”
String breed = “unkown”
}
createDog(“Fifi”, “Yorkshire Terrier”)
createDog(“Yorkshire Terrier”)
createDog()
Constructor overloads
Kotlin, vem dar uma mão nas chamadas a partir de Java