What is significance of putting “$” sign before a parameter in Java / Android?

后端 未结 5 1704
一生所求
一生所求 2021-01-20 23:29

What is the difference or significance of putting $ sign before any variable or parameter..

e.g.

Suppose here is my class...

 public class Vecto         


        
5条回答
  •  孤城傲影
    2021-01-20 23:40

    Variable names are case-sensitive. 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.

    Taken from : ttp://download.oracle.com/javase/tutorial/java/nutsandbolts/variables.html#naming

提交回复
热议问题