mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
16 lines
284 B
Kotlin
16 lines
284 B
Kotlin
abstract class Base {
|
|
abstract fun foo(a: String = "abc"): String
|
|
}
|
|
|
|
class Derived: Base() {
|
|
override fun foo(a: String): String {
|
|
return a
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val result = Derived().foo()
|
|
if (result != "abc") return "Fail: $result"
|
|
|
|
return "OK"
|
|
} |