You have following array int data new int10 data0 1 data1
You have following array: int[] data = new int[10]; data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; What are the values of: data[0], data[4], data[5], data[6] and data[10]. Note: if there is no value for any one, just write ERROR.
Solution
3.
4.
Reason : Since there is no value assigned to the number thus the default value of
Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException: 10
Reason :
![You have following array: int[] data = new int[10]; data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; What are the values of: data[  You have following array: int[] data = new int[10]; data[0] = 1; data[1] = 2; data[2] = 3; data[3] = 4; data[4] = 5; data[5] = 6; What are the values of: data[](/WebImages/30/you-have-following-array-int-data-new-int10-data0-1-data1-1084612-1761570086-0.webp)
