https://kotlinlang.org logo
r

Ruckus

06/30/2017, 6:36 PM
Tested with this and it works as expected:
Copy code
class MyTest {
    private val stringRepresentation = "Initialized with $X"

    override fun toString() = stringRepresentation

    companion object {
        const val X = "Context"
    }
}

fun main(args: Array<String>) {
    println(MyTest())
}