示例代码如下,请问如何在c类中调用a类中的new函数?class a { _x: number; constructor() { this._x = 1; } new(i: number) { this._x = i; }}class b extends a { _y: number; constructor() { super(); this._y = 2; } new(i: number) { this._y = i; }}class c extends b { _z: number; constructor() { super(); this._z = 3; } new(i: number) { super.new(i); }}上面代码 c类的new函数语句super.new(i) 调用的是 b类中的new函数。b类中的new函数好像把a类中的override了.
添加回答
举报
0/150
提交
取消