How can I create an array in Kotlin like in Java by just ...
In Kotlin, creating an IntArray of size N is simple. Use IntArray(n) or the appropriate type, as detailed thoroughly in hotkey's answer. When utilizing your fixed size array, you can use Kotlin Destructuring // Create fixed sized array val point = IntArray(2) // Access values directly val (x, y) = point
DA: 18 PA: 84 MOZ Rank: 24