Browsing tag:

listOf

Kotlin: Array vs List – Similarities and Differences

// Initializing array and list val array = arrayOf(1, 2, 3) val list = listOf(“apple”, “ball”, “cow”) val mixedArray = arrayOf(true, 2.5, 1, 1.3f, 12000L, ‘a’) // mixed Array val mixedList = listOf(false, 3.5, 2, 1.4f, 13000L, ‘b’) // mixed List Arrays An array is a container object that holds a fixed number of values […]