mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
30 lines
400 B
Kotlin
Vendored
30 lines
400 B
Kotlin
Vendored
// FILE: protectedPack/J.java
|
|
|
|
package protectedPack;
|
|
|
|
public class J {
|
|
protected String foo() {
|
|
return "fail";
|
|
}
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
package protectedPackKotlin
|
|
|
|
import protectedPack.J
|
|
|
|
class Derived : J() {
|
|
protected override fun foo(): String? {
|
|
return "OK"
|
|
}
|
|
|
|
fun test(): String {
|
|
return foo()!!
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return Derived().test()
|
|
}
|