class Father {
name!: string;
constructor() {
this.say()
}
private say() {
console.log('father')
}
}
class Son extends Father {
constructor() {
super()
this.say()
}
/* 不允许重写private方法 */
say() {
console.log('son')
}
}
let son = new Son()