ts重点学习71-抽象类笔记
export default {}
abstract class Person {
abstract name: string;
abstract show(): string;
showName() {
console.log(this.show());
}
}
class Student extends Person {
name: string = "孟子义";
age: number = 18;
show(): string {
return "陈情令"
}
}
// let p = new Person();
let s = new Student();
let res = s.show();
console.log(res);

浙公网安备 33010602011771号