Page 314 - CITS - Computer Software Application -TT
P. 314
COMPUTER SOFTWARE APPLICATION - CITS
What is a Variable in Java?
Variable in Java is a data container that stores the data values during Java program execution. Every variable is
assigned a data type which designates the type and quantity of value it can hold. Variable is a memory location
name of the data. The Java variables have mainly three types : Local, Instance and Static.
In order to use a variable in a program you to need to perform 2 steps
1 Variable Declaration
2 Variable Initialization
Variable Declaration
To declare a variable, you must specify the data type & give the variable a unique name.
Examples of other Valid Declarations are
301
CITS : IT&ITES - Computer Software Application - Lesson 78 - 84
78