1. Assume that the array a contains the five integers 34, 23, 67, 89, and 12. Write the values of the following expressions:- a. 34 b. a[a.length -1] =4 c. a[2]+ a[3] = 156What happens when a program attempts to access an item at an index that is less than 0 or greater than or equal to the array’s length?– The JVM checks the values of subscripts before using them and throws an ArrayIndexOutOfBoundsException if they are out of bound.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | ||