2.14抽象类
abstract class Geom { getType() { return "Gemo"; } width: number; abstract getArea(): number; // 抽象方法 } class Circle extends Geom { getArea() { return 123; } } class Square {} interface Person8 { name: string; } interface Teacher8 extends Person8 { teacheringAge: number; } interface Student8 extends Person8 { age: number; } const teacher8 = { name: "dell8", }; const student8 = { name: "lee8", age: 15, }; const getUserInfo = (user: Person8) => { console.log(user.name); }; getUserInfo(teacher8); getUserInfo(student8);