【发布时间】:2019-06-19 23:09:11
【问题描述】:
我的班级:
class Manager (var name: String, var nationality: String) {
constructor(agent: String): this() {}
}
返回以下错误:
None of the following functions can be called with the arguments supplied.
<init>(String) defined in Manager
<init>(String, String) defined in Manager
知道为什么吗?
【问题讨论】:
-
提示:
this()调用的是什么构造函数? -
你能解释一下
this()在这里做什么吗?我从教程中获取了代码。
标签: kotlin