Scala超类构造函数 (Scala Superclass constructors)
A Constructor a method of the class that is used to initialize the object state in Scala class and are invoked by the compiler when the object of the class is created. In Scala programming language you can create any number of constructors for a class but there needs to be a single primary constructor which is the end of the constructor chain.
构造函数,该类的方法用于初始化Scala类中的对象状态,并在创建类的对象时由编译器调用。 在Scala编程语言中,您可以为一个类创建任意数量的构造函数,但必须有一个主构造函数,该主构造函数位于构造函数链的末尾。
If we define a subclass, then it has to by default call any of the constructors of the superclass in its object creation. The calling constructor of the superclass can be a call to any of the available constructor of the superclass (primary or auxiliary).
如果我们定义一个子类,则默认情况下它必须在其对象创建中调用超类的任何构造函数 。 超类的调用构造函数可以是对超类任何可用的构造函数(主或辅助)的调用。
There are multiple ways for calling a constructor of superclass,
有多种方法可以调用超类的构造函数,