Variable in Java
Published: (January 5, 2026 at 10:51 AM EST)
1 min read
Source: Dev.to
Source: Dev.to
Variable
- A variable is the name of a memory location.
- A variable is used to store a value.
- The value of a variable can change during program execution.
Rules for Variable Names in Java
- Variable name should start with a lowercase letter.
- Variable name can start with
$or_.
Example
byte tamilMark = 60;
Explanation
byte→ data typetamilMark→ variable name=→ assignment operator60→ value;→ end of statement