I see that Kotlin has ByteArray, ShortArray, IntArray, CharArray, DoubleArray, FloatArray
, which are equivalent to byte[], short[], int[],char[], double[]
To create an empty Array of Strings in Kotlin you should use one of the following six approaches:
First approach:
val empty = arrayOf()
Second approach:
val empty = arrayOf("","","")
Third approach:
val empty = Array(3) { null }
Fourth approach:
val empty = arrayOfNulls(3)
Fifth approach:
val empty = Array(3) { "it = $it" }
Sixth approach:
val empty = Array(0, { _ -> "" })