프로그래밍/Kotlin

[Kotlin] Int[] n = new Int[size]

DwEnn 2018. 8. 9. 23:59
728x90
반응형

Int[] n = new Int[size]



자바에서 처럼


Int[] n = new Int[size]


이런 식의 코딩을 하려면,


val n = arrayOfNulls<Int>(n)



이와 같이 하면 된다



+References


https://stackoverflow.com/questions/35253368/how-can-i-create-an-array-in-kotlin-like-in-java-by-just-providing-a-size >

반응형