Correct way of declaring arrays using the Array() constructor?
I know that the Array() constructor takes in two arguments: the size of the array and a function which receives the index of an array and returns the value for that index.
I've written some example programs in the
kotlinlang.org online IDE, and have declared & initialised my arrays as such:
var array = Array(9, {i -> ' '})
A "blank" char array of size 9, completely filled with whitespaces. This works fine in the
kotlinlang.org compiler, and runs well too; however, when I try to import the...