When should I use the dollar symbol ($) in a variable name?

后端 未结 6 1674
情歌与酒
情歌与酒 2020-12-17 09:10

The dollar symbol ($) is a valid character to name a variable, e.g. String superSecretFormula$;, but when we\'re talking about naming conventions, when should I

6条回答
  •  遥遥无期
    2020-12-17 09:39

    From the Java Language Specification on identifiers:

    The $ character should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.

提交回复
热议问题