Array in Scala
In Scala arrays are immutable objects.
First you declare variable var myArray to be of type Array[Int]. That is a Int array. If you had needed an array of e.g. String, replace String with String.
Array is 0 base indexing, meaning index starts from 0
Once created, length of an array can not be changed.
Last updated