// Kotlin var title: String = "a" class Foo { var title: String = "x" init { title = "b" } } fun main(args: Array<String>) { val foo = Foo() println(title) println(foo.title) }
a b
(edited)// Kotlin fun main(args: Array<String>) { var title: String = "a" class Foo(var title: String = "x") { init { title = "b" } } val foo = Foo() println(title) println(foo.title) }
b x
(edited)