Ask Question
18 August, 13:17

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

+4
Answers (1)
  1. 18 August, 17:06
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers