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[

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site