| 42 | } |
| 43 | // private 只能类本身调用,不能被类的实例调用,也不能被类的子类调用 |
| 44 | class Dog3 { |
| 45 | constructor(name: string) { |
| 46 | this.name = name |
| 47 | } |
| 48 | public name: string |
| 49 | run() {} |
| 50 | private pri(){} |
| 51 | } |
| 52 | let dog3 = new Dog3('test') |
| 53 | // dog3.pri() // 不能被类的实例调用 |
| 54 |
nothing calls this directly
no outgoing calls
no test coverage detected