IntArray vs Array in Kotlin

后端 未结 3 1515
忘掉有多难
忘掉有多难 2020-11-30 02:29

I\'m not sure what the difference between an IntArray and an Array is in Kotlin and why I can\'t used them interchangeably:

3条回答
  •  独厮守ぢ
    2020-11-30 02:45

    It is worth noting that using the spread (*) operator on a vararg will return an IntArray. If you need an Array, you can convert your IntArray using .toTypedArray().

提交回复
热议问题