Home › Java › Java Variables

Java Variables

Last updated: 28 Sep 2026

A variable is a named place in memory that holds a value. You must declare its type before using it.

int age = 20;
double price = 99.5;
String name = "Asha";
final int MAX = 100; // constant

Variable names are case-sensitive, cannot start with a digit and cannot be a keyword. By convention they use camelCase.