You have created an array to hold three strings. When you run the code below, the compiler displays an error. Why does the code fail?
val names = arrayOf(3) names[3]= "Delta"
val names = arrayOf(3) names[3]= "Delta"A. Arrays use zero-based indexes. The value 3 is outside of the array's bounds
B. You accessed the element with an index but should have used .set()
C. You declared the array with val but should have used var
D. You cannot change the value of an element of an array. You should have used a mutable list
Answer: Option A
Related Questions on Kotlin Program
A. A new version of Java.
B. A JavaScript framework.
C. A statically-typed programming language for the JVM, Android, and browser.
D. A database management system.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP

Join The Discussion