Computer Applications

Differentiate between Ordinary variable and array variable

Java Arrays

83 Likes

Answer

Ordinary variableArray variable
An ordinary variable can hold only one value.An array variable can refer to a group of values of the same data type by using a subscript.
For example:
int a;
Here variable a holds one int type value.
For example:
int a[ ] = new int[5];
Here variable a[ ] can store 5 integer type values which will be accessed as a[0], a[1], a[2], a[3] and a[4];

Answered By

41 Likes


Related Questions