01-typescript-inheritance-overview
01-typescript-inheritance-overview
Inheritance
Parameter
Properties
getInfo(): string {
return `x=${this._x}, y=${this._y}`;
}
}
getInfo(): string {
return `x=${this._x}, y=${this._y}`;
}
}
Parameter Property
_radius
getInfo(): string {
return super.getInfo() + `, radius=${this._radius}`;
}
}
File: Circle.ts
File: Circle.ts
File: Circle.ts
File: Circle.ts
super(theX, theY);
}
super(theX, theY);
}
super(theX, theY);
}
Parameter Properties
_width and _length
super(theX, theY);
}
Parameter Properties
_width and _length
Call superclass
constructor
super(theX, theY);
}
super(theX, theY);
}
super(theX, theY);
}
getInfo(): string {
super(theX, theY);
}
getInfo(): string {
return super.getInfo() + `, width=${this._width}, length=${this._length}`;
super(theX, theY);
}
getInfo(): string {
return super.getInfo() + `, width=${this._width}, length=${this._length}`;
}
super(theX, theY);
}
getInfo(): string {
return super.getInfo() + `, width=${this._width}, length=${this._length}`;
}
}
… …
… …
… …
… …
… …
… …
… …