14 lines
299 B
TypeScript
14 lines
299 B
TypeScript
import {Animal} from './animal';
|
|
|
|
// make the class cat inherit from Animal
|
|
export class Cat extends Animal {
|
|
// override make_sound
|
|
public make_sound() {
|
|
// optional: call the parent class function
|
|
super.make_sound();
|
|
|
|
// add additional functionality
|
|
console.log('meow');
|
|
}
|
|
}
|