Ask Question
18 July, 04: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. 18 July, 07:40
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers