Is there a convention when using Java RMI to use the dollar sign $ in a variable name?

I understand that this is the real part of the variable name, but I have never seen variable names actually use the $ before character.

The Java tutorial says the following:

In addition, the dollar sign, by convention, is never used at all. You may find some situations where auto-generated names will contain a dollar sign, but your variable names should always avoid using it.

However, since this is aimed at Java newbies, I wonder if there is a value with a special meaning in a distributed world.

+1
source share
5 answers

The only time I ever saw this

  • , $ ,
  • internal- > , , , $
  • ( JVM)

, , . $ .

+3

, Java, , .

, '$' - , .

, JLS , :

" Java ASCII A-Z A-Z, - ASCII (_) ($). $ , , ." - JLS 3.8.

, $' , , - "private" . , "$" , , ( ) .

"$" , , Java, . , Java, , , , .

, '$' , , Java ( ) , .

+2

, , - BigInteger $33 = BigInteger.valueOf(33L);

.

0

.

No, I would not use it in a variable name. There is nothing special about RMI to guarantee such a choice.

0
source

If you want to see real (possibly) human-written code that makes extensive use of "$" for variable naming, you can take a look at PacketWorld (a modeling tool for multi-agent systems).

I just started working with him and was sent here after searching on Google: "Why use a dollar in java?".

Still not making sense :(

0
source

All Articles