为什么AtomicInteger在Kotlin中是抽象的? (它在Java中工作正常)

我试图做出类似的东西(实际上你不需要阅读链接来理解这个问题,只是供参考),我写这个:

class CallArbiter: AtomicInteger { // error constructor(initialValue: Int) : super(initialValue) constructor() : super() } 

编译器说:

错误:(8,1)Kotlin:Class'CallArbiter'必须声明为抽象或实现抽象基类的成员public abstract fun toByte():java.util.concurrent.atomic.AtomicInteger

我不明白为什么它需要我实施这些方法。 我没有看到他们在AtomicInteger类。 在Java中一切都很好。

AtomicInteger扩展了java.lang.Number ,但是在Kotlin中这个类型映射到了kotlin.Number

kotlin.Number中定义了这些抽象方法(您可以在其API中看到):

toBytetoInttoChar

如果你调试这行代码: AtomicInteger(2).toByte()你可以看到,方法java.lang.Number::byteValue被使用,这是通过使用某些编译器技术来完成的。