运行 ❯
Node 服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
class Person { private name: string; public constructor(name: string) { this.name = name; } public getName(): string { return this.name; } } const person = new Person("Jane"); console.log(person.getName()); // person.name isn't accessible from outside the class since it's private
Jane