
4.10 Simple IO and Arrays and String Vectors
System.out.println(“ Enter Array [“ + i +”]element”);
input=in.readLine();
myArray[i] = Integer.parseInt(input);
} // end of for loop
4.3.3 How Are Arrays Stored in the Memory?
Consider an array named x, declared as int [] x = new int []{80,90,100,50,65,70};
The addresses shown above are dummy addresses. Using of size of operator would tell us
the memory requirement of data type int on your hardware. Assuming that it is 24 bytes, the
memories of the array element are shown in Figure 4.3.
4.3.4 Accessing and Modifying Array Elements
To access an element in the array we must provide the array name and ...