fun Int.print() = println(this) 5.print() // prints 5
fun Context.toast(text: CharSequence, duration: Int = Toast.LENGTH_SHORT): Toas t { return Toast.makeText(this, text, duration).apply { show() } } toast("Hello Toast")
class AquariumPlant( val color: String) fun AquariumPlant.print() = println("Pretty Aquarium Plant") val plant = AquariumPlant("green") plant.print() // prints -> Pretty Aquarium Plant
HHHHH
Google Developers Indonesia Blog
Google on Follow @googledevsid
fun Int.print() = println(this) 5.print() // prints 5
fun Context.toast(text: CharSequence, duration: Int = Toast.LEN...