MCPcopy Create free account
hub / github.com/SincereCSL/Playgrounds / Husky

Class Husky

TypeScript/StudyTypeScript/src/class_01.ts:23–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22// 类:类的继承
23class Husky extends Dog {
24 constructor(name: string, public color: string){
25 super(name)
26 this.color = color
27 this.pro() // 受保护成员子类中可以访问
28
29 }
30 // color: string
31}
32console.log(Husky.food) //类的静态成员可以被继承,子类调用
33
34/// 类: 类的成员修饰符

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected