Computer Applications

Element amount[9] is which element of the array ?

  1. the eighth
  2. the ninth
  3. the tenth
  4. impossible to tell.

Java Arrays

4 Likes

Answer

the tenth

Reason — In Java arrays, element at position 1 has index/subscript 0, element at position 2 has index 1, element at position 3 has index 2 and so on. Thus, position of an element is [index + 1]. Hence, amount[9] (9 + 1 = 10) will be the tenth element of the array.

Answered By

2 Likes


Related Questions