What's the Kotlin equivalent of Java's String[]?

后端 未结 8 1231
感情败类
感情败类 2020-12-23 08:26

I see that Kotlin has ByteArray, ShortArray, IntArray, CharArray, DoubleArray, FloatArray, which are equivalent to byte[], short[], int[],char[], double[]

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 09:28

    Those types are there so that you can create arrays of the primitives, and not the boxed types. Since String isn't a primitive in Java, you can just use Array in Kotlin as the equivalent of a Java String[].

提交回复
热议问题