mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
27 lines
387 B
Kotlin
Vendored
27 lines
387 B
Kotlin
Vendored
// FILE: JavaClass.java
|
|
|
|
public class JavaClass {
|
|
private String x = null;
|
|
|
|
public String getX() { return "OK"; }
|
|
protected void setX(String x) { this.x = x; }
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
package p
|
|
|
|
import JavaClass
|
|
|
|
fun box(): String {
|
|
return KotlinClass().ok()
|
|
}
|
|
|
|
class KotlinClass : JavaClass() {
|
|
fun ok(): String {
|
|
x = "o"
|
|
x += "k"
|
|
return x
|
|
}
|
|
}
|