任何此类附加构造函数都必须调用主构造函数。
Any such additional constructors must call the primary constructor.
Scala可以区分主构造函数和0个或多个辅助构造函数。
Scala distinguishes between a primary constructor and zero or more auxiliary constructors.
一种是主构造函数,其参数出现在紧靠类型名称后面的括号中。
One is the primary constructor, whose parameters appear in parentheses just after the type name.
它调用主构造函数,并且传入Nil (Nil表示了一个空的List对象)。
It calls the primary constructor with Nil (which represents an empty List object).
主构造函数,类的主题,有一个参数列表来接受标签字符串和回调函数的列表。
The primary constructor, which is the body of the entire class, has a parameter list that takes a label string and a list of callback functions.
子类的主构造函数必须调用父类的一个构造函数,无论是主构造函数或者是辅助构造函数。
The primary constructor in a derived class must invoke one of the parent class constructors, either the primary constructor or an auxiliary constructor.
Traits不支持辅助构造函数,它们也不支持在主构造函数,trait的主体里的参数列表。
Traits don't support auxiliary constructors, nor do they accept an argument list for the primary constructor, the body of a trait.
被调用的构造函数可以是另外一个辅助构造函数或者主构造函数,而且它必须出现在辅助构造函数主体的第一句。
The constructor invoked may be either another auxiliary constructor or the primary constructor, and it must be the first statement in the auxiliary constructor's body.
因为所有的辅助构造函数最终都会调用主构造函数,它主体中进行的逻辑检查和其它初始化工作会在所有实例被创建的时候执行。
Because all auxiliary constructors eventually invoke the primary constructor, logic checks and other initializations done in the body will be performed consistently for all instances created.
RadioButtonWithCallbacks的主构造函数接受3个参数,一个开关状态(真或假),一个标签,以及一个回调函数例表。
The primary constructor for RadioButtonWithCallbacks takes three parameters: an on state (true or false), a label, and a list of callbacks.
主构造函数接受一个label(标签)参数和一个callbacks(回调)的list(列表),这些回调函数会在按钮的click方法被调用时被调用。
The primary constructor takes a label argument and a list of callbacks that are invoked when the button's click method is invoked.
主构造函数接受一个label(标签)参数和一个callbacks(回调)的list(列表),这些回调函数会在按钮的click方法被调用时被调用。
The primary constructor takes a label argument and a list of callbacks that are invoked when the button's click method is invoked.
应用推荐