Refer to the code snippet---
class AuxDuck()
{
var size = 0
var age = 0
println("Slayer")
def this(size:Int)
{
this()//calls primary constructor
this.age=age
}
def this(size:Int, age:Int)
{
this(size) // calls previous auxiliary constructor
this.age=age
}
}
object AuxilaryConstructor extends App
{
var d1 = new AuxDuck()
println(d1.size + "," +d1.age)
It gives output---
Slayer
0,0
May I know how the Slayer got printed?
Is there any role of primary constructor in this printing of Slayer?