hi everyone,
what is difference between companion object and object keyword? tks so much
17 replies
companion object Foo {
const val count: Int = 2
var VALUES = arrayOf("X", "Y", "Z")
}
object Foo2 {
var provider: String = "HAI"
var xxx: Int= 0
const val count: Int = 2
}
Both can be called from another context via AnotherClass.Foo and AnotherClass.Foo2