我对Kotlin构造函数有疑问.
class abc {
constructor(a: Int)
constructor(a: Int, e: Int)
}
class def(a: Int) {
constructor(a: Int, e: Int) : this(a)
}
Run Code Online (Sandbox Code Playgroud)
为什么我需要在def类中调用这个(a)?
abc和def之间有什么不同?
| 归档时间: |
|
| 查看次数: |
441 次 |
| 最近记录: |