classPerson{public name
protected jobs
private age
readonly sex
constructor(name, jobs, age, sex){this.name = name
this.jobs = jobs
this.age = age
this.sex = sex
}say(){
console.log(this.name,this.jobs,this.age,this.sex)}}let p =newPerson('aa','bb',12,'女')
p.say()
问题描述在类中,可以对属性或方法进行权限约束,例如 public(默认)、protected、private、readonly(ts)我们可能会写这样的代码class Person { public name protected jobs private age readonly sex constructor (name, jobs, age, sex) { this.name = name this.jobs =