Basic Java Language: Difference between revisions

Line 56: Line 56:
You can declare multiple variables on one line, if you wish:
You can declare multiple variables on one line, if you wish:
<pre> boolean a, b;</pre>
<pre> boolean a, b;</pre>
Also, you can change variables after you already give them a value.
<pre>[v you want to change] = [v you want it to be]</pre>
===Identifiers===
===Identifiers===
There are several rules for the naming of your variables. Identifiers can be named using all the letters from A through Z (capital or lowercase, you choose), numbers 0-9 and underscore _ and the dollar sign $. The first character of the identifier cannot be a number, but it can be a letter, _ or $.  
There are several rules for the naming of your variables. Identifiers can be named using all the letters from A through Z (capital or lowercase, you choose), numbers 0-9 and underscore _ and the dollar sign $. The first character of the identifier cannot be a number, but it can be a letter, _ or $.