Question: You have created an array to hold three strings. When you run the code bellow, the compiler displays an error. Why does the code fail?
- Arrays use zero-based indexes. The value 3 is outside of the array's bounds
- You accessed the element with an index but should have used.set().
- You declared the array with val but should have used var
- You cannot changes the value of an element of an array. You should have used a mutable list.
Answer: The correct answer of the above question is Option A:Arrays use zero-based indexes. The value 3 is outside of the array's bounds