Question : static variable in kotlin
Answered by : abdullah-0kvpuik7ilzv
companion object { lateinit var myStaticStr: String }
Source : | Last Update : Fri, 23 Jul 21
Question : kotlin static variable
Answered by : abdullah-0kvpuik7ilzv
class Test {
companion object { var mInteger: Int = 10 fun hello() = println("hello world !") }
}
fun main(args: Array<String>) { print(Test.mInteger) print(Test.hello())
}
Source : | Last Update : Tue, 31 Aug 21