mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
24 lines
376 B
Kotlin
Vendored
24 lines
376 B
Kotlin
Vendored
// FILE: JavaClass.java
|
|
|
|
class JavaClass<T> {
|
|
protected void execute(T t, Runnable r) {
|
|
r.run();
|
|
}
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
internal class KotlinClass : JavaClass<String>() {
|
|
fun doIt(): String {
|
|
var result = ""
|
|
execute("") {
|
|
result = "OK"
|
|
}
|
|
return result
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return KotlinClass().doIt()
|
|
}
|