Kotlin

코틀린 배열 초기화 방법

Machine_웅 2019. 2. 11. 14:00
728x90
반응형
var arr = IntArray(size, { 0 } ) // construct with size and fill array with 0
var arr = IntArray(size, { it * 1 } ) // construct with size and fill with its index

var arr = intArrayOf(1, 2, 3, 4, 5) // create an array with 5 values

728x90
반응형