Computer Applications
Element amount[9] is which element of the array ?
- the eighth
- the ninth
- the tenth
- 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