<https://kotlinlang.org/docs/object-declarations.h...
# getting-started
j
https://kotlinlang.org/docs/object-declarations.html#companion-objects under companion objects there is this "Class members can access the private members of the corresponding companion object." Can someone show me the extent of what this means with a code example?
l
Copy code
class CompanionTest {
    companion object {
        private val defaultName = "name"
    }

    var name = defaultName
}
We can assign the private member
defaultName
, which is located in the companion object, to the class member
name
.