Just like we have some rules that we follow to speak English(the grammar), we have some rules to follow while writing a java program. The set of this rules is called as syntax.
A variable is a container that stores a value. This value can be changed during the execution of the program.
Rules for declaring a variable name:
We can choose a name while declaring a java variable if the following rules are followed :