我正在创建一个基类。
我有一些代码start()。
还有一个bar()需要被继承Foo的类覆盖
start() 调用 bar()
我的例子(foo.kt):
open class Foo {
fun start() {
bar()
//...
}
fun bar() {
TODO("implement me in deriving class")
}
}
Run Code Online (Sandbox Code Playgroud)
我不喜欢酒吧()抛出一个例外, 我不喜欢离开酒吧()与坯体无论是
有什么我忘记的东西是Kotlin 中更好的选择吗?
kotlin ×1