Answers for "class object in kotlin"

1

object kotlin

val helloWorld = object {
    val hello = "Hello"
    val world = "World"
    // object expressions extend Any, so `override` is required on `toString()`
    override fun toString() = ""
}
print(helloWorld.hello+ " ")
print(helloWorld.world)
Posted by: Guest on August-03-2021
1

kotlin class

class Person(val name: String, var age: Int)
Posted by: Guest on January-15-2021

Browse Popular Code Answers by Language