https://kotlinlang.org logo
#announcements
Title
# announcements
i

Ifvwm

07/19/2019, 6:29 AM
I don't understand why java/kotlin have List and Array, 'cause C only have Array, Python only have List, Haskell have List, why java/kotlin have both? what's the meaning???
🙄 1
g

gildor

07/19/2019, 6:35 AM
Because Array is JVM specific thing and very important for some performance optimizations, it’s essentially direct mapping to memory, Haskell list is like LinkedList in Kotlin/Java, which is not very efficient, especially with mutable data structures
👍 1
Also it’s not true about Haskell. Haskell also has Data.Array
Kotlin Array is like C Array, you cannot change size of it after creation And Kotlin List is more like Python List
2 Views