Ask Question
13 September, 16:40

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.

+3
Answers (1)
  1. 13 September, 16:55
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers