Which of the following can be considered as the object of an array?
A) Index of an array
B) Functions of the Array
C) Elements of the Array
D) All of the above
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Answer: C) Elements of the Array
Elements of the array is to be considered as the object of an array
Answer: C) Elements of the Array
Explanation: Elements of the array is to be considered as the object of an array
Below example shows object of an array is known as elements of the array
The output from this program is:
0 1 2 3 4 5 6 7 8 9
int[] exarray; // declaration of an array
an array declaration has two components: the array’s type and the array’s name. An array’s type is written type[], here type is the data type of the elements contained within the array, and [] indicates that this is an array.
exarry = new int[10]; // creating an array
creating an array, we use new operator, And the data type of the array elements, And the number of elements enclosed within brackets[ ].
above code shows that to an array element(exArray), either to assign a value to it or to get its value, append brackets to the array name(exArray[i]). The value between the brackets indicates (with a variable or other expression) the index of the element to access.
Hence the answer is option C) Elements of the Array
Answer: C) Elements of the Array