A variable’s name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign “$”, or the underscore character “_”. The convention, however, is to always begin your variable names with a letter, not “$” or “_”. Additionally, the dollar sign character, by convention, is never used at all. You may find some situations where auto-generated names will contain the dollar sign, but your variable names should always avoid using it. A similar convention exists for the underscore character; while it’s technically legal to begin your variable’s name with “_”, this practice is discouraged. White space is not permitted
java 字符串是对象吗_java – 什么对象._(“这里的字符串”)是什么意思?
最新推荐文章于 2021-02-25 18:09:30 发布
"本文介绍了变量命名的规则,建议变量名以字母开头,避免使用美元符号"$"和下划线开头。虽然下划线在技术上是合法的,但不推荐。同时,文章强调了避免在变量名中使用美元符号,并且对于下划线的使用也持谨慎态度。内容还提及了自动生成的名称可能包含美元符号,但在个人编程实践中应避免这种情况。"
摘要由CSDN通过智能技术生成