An ArrayList of Integer s named a has been declared with 12 elements . The integer variable k holds a value between 2 and 8. Assign 22 to the element just before the element at k.

An ArrayList of Integer s named a has been declared with 12 elements . The integer variable k holds a value between 2 and 8. Assign 22 to the element just before the element at k.

LANGUAGE: JAVA

CHALLENGE:

An ArrayList of Integer s named a has been declared with 12 elements . The integer variable k holds a value between 2 and 8. Assign 22 to the element just before the element at k.

SOLUTION:

a.set(k-1, 22);

Add comment