mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 15:54:03 +00:00
11 lines
232 B
Kotlin
Vendored
11 lines
232 B
Kotlin
Vendored
class Box(val s: String) {
|
|
fun extract(): String {
|
|
var result = ""
|
|
Runnable { result = s }.run() // capturing this and local var
|
|
return result
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return Box("OK").extract()
|
|
} |