Rules and conventions for naming a variable in Java

  • Variable name can be of unlimited length of letter and digits.
  • Variable name can start with $ or _ but not advisable.
  • Variable name should not start with numbers.
  • Variable name is case-sensitive.
  • Whitespace or space is not permitted.
  • Name should not be a keyword in Java.

If you want to look list of keywords in Java, click here.

What is a variable or datatype and why they are used detailly ?