Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以通过指示一个变量是静态类变量来使我的代码更清晰。如果它不是静态的,我可以使用 this.variableName,每个人都会看到它并立即知道这一点。
我知道我可以采用像 s_variableName 这样的命名约定,但这对我来说似乎有点奇怪,并且增加了代码的学习曲线。
静态变量是否有“this”的等价物?
使用类型名称对其进行限定:
TypeName.staticVariableName