https://blog.csdn.net/lucky541788/article/details/107793816
构造函数被标记成 protected。 这意味着这个类不能在包含它的类外被实例化,但是能被继承
class temp{
readonly time = '123'
protected constructor(name:any){
console.log(name)
}
}
class val extends temp{
constructor(){
super('oooooo')
}
}
const person = new val()
使用protect后Derived类实例化时无法自动调用Base类构造器函数
使用private字段修饰constructor后不能扩展类'temp'。类构造函数被标记为私有
private constructor