class TestScope2 constructor() { var x: Int = 300 // Unit: 返し値 がないことを示す. fun y(): Unit { var x: Int = 400 println(x) } } fun main() { val testScope2: TestScope2 = TestScope2() testScope2.y() }