Is the following statement correct? > In Java,...
# getting-started
s
Is the following statement correct?
In Java, arrays store primitive types whereas collections store boxed types. In Kotlin, both arrays and collections store boxed type whereas one can use classes like
IntArray
,
ByteArray
, etc. to store primitive data type without boxing.
e
Java has both boxed and primitive arrays
primitive collections can exist too - e.g. the ones provided by Eclipse Collections for Java - but they're not built in
n
Kotlin has IntArray (unboxed) and Array<Int> (boxed) Java as int[] (unboxed) and Integer[] (boxed). collections in both languages are always boxed.