Ask Question
7 May, 00:23

Which of the following about Java arrays is true?

(i) All components must be of the same type.

(ii) The array index and array element must be of the same type.

+5
Answers (1)
  1. 7 May, 03:45
    0
    Option (i) is true

    Explanation:

    In java arrays, index number of array is of integer type whereas each item of the array needs to be of same type but they can be of any type like string, integer, float etc. Their data type may match with the index's type but needs not necessarily be the same.

    For example : arr[4]="Hello" is possible but arr[5]=45 is not legal as arr will contain items of similar data type.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which of the following about Java arrays is true? (i) All components must be of the same type. (ii) The array index and array element must ...” 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