更新时间:2023-10-10 07:51:45
只有一个构造函数.默认值保留在人"随行对象中.呼叫 new Person(年龄= 10)
会变成类似 new Person(Person.< init> $ default $ 1(),10)
.
There is only one constructor. The default values are kept in the Person companion object.
A call new Person(age = 10)
is turned into something like new Person(Person.<init>$default$1(), 10)
.