Computer Applications
How is one-dimensional array represented in memory ?
Java Arrays
6 Likes
Answer
Single-dimensional arrays are lists of information of the same type and their elements are stored in contiguous memory locations in their index order.
For example, an array grade of type char with 8 elements declared as
char grade[ ] = new char[8];
will have the element grade[0] at the first allocated memory location, grade[1] at the next contiguous memory location, grade[2] at the next, and so forth. Since grade is a char type array, each element size is 2 bytes and it will be represented in memory as shown in the figure given below:

Answered By
6 Likes
Related Questions
Arrays do not prove to be useful where quite many elements of the same data types need to be stored and processed. (T/F)
A subscript of an element designates its position in the array's ordering. (T/F)
Determine the number of bytes required to store an int array namely A[23].
An array element is accessed using …………… .
- a first-in-first-out approach
- the dot operator
- an element name
- an index number