【发布时间】:2019-06-19 22:41:13
【问题描述】:
有什么区别:
class Pitch(var width: Int = 3, var height: Int = 5) {
constructor(capacity: Int): this()
}
和
class Pitch(var width: Int = 3, var height: Int = 5, capacity: Int)
构造函数提供了哪些优势?
【问题讨论】:
标签: kotlin constructor class-constructors