Ask Question
24 July, 23:43

An array is stored in contiguous memory locations. You access the individual array value by using the array name followed by the index location. In other words, here is the array:

42 27 36 94 12 44 18

1. If you want to access the third value (36), you would use numbers[2]

O True

O False

+2
Answers (1)
  1. 25 July, 03:24
    0
    True

    Explanation:

    Indexing in arrays start at zero, so the last element of an array with n number of elements will have the index n-1.

    Lets create a simple java application that will print the elements at different indexes of this given array

    public class ANot {

    public static void main (String[] args) {

    int [] numbers = {42,27,36,94,12,44,18};

    System. out. println ("Element at index 0 is "+numbers[0]);

    System. out. println ("Element at index 1 is "+numbers[1]);

    System. out. println ("Element at index 2 is "+numbers[2]);

    }

    }

    The output of this code is:

    Element at index 0 is 42

    Element at index 1 is 27

    Element at index 2 is 36
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “An array is stored in contiguous memory locations. You access the individual array value by using the array name followed by the index ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers