...

/

Variables in Java

Variables in Java

Get an introduction to variables, their naming conventions, where they are stored in memory, and how much space they take.

Introduction

Variables are just like containers which hold the values while the program is executed.

A variable is a storage location paired with an associated symbolic name (an identifier), which contains some known or unknown quantity of information referred to as a value.

Variables in Java are strongly typed; thus they all must have a data type declared with their identifier. In this lesson, we will discuss identifiers.

Naming a variable

Just as every person has a name that helps identify them, every variable has a name associated with it. There are certain naming conventions that one must follow in order to decide a name for the ...