When playing around with Scala I had a code like this:
class Superclass(var i : Int){}
class Subclass(i : Int) extends Superclass(0) {
print(i)
}
I found out that print(i)
prints the constructor parameter i
of Subclass(i : Int)
Now, my question is: in a situation like this, how do I access the field i
of Superclass
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…