📜  typescript 抽象类示例 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:30.647000             🧑  作者: Mango

代码示例1
abstract class APerson {
   abstract getName(): string
}

class Person extends APerson {
   getName(): string {
      return "john doe"
   }
}

const res = new Person()
console.log(res.getName())