Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different Between ArrayList, IntArray and Array<Int> [duplicate]

Tags:

java

kotlin

I am new in Java and Kotlin.

Recently when I read a tutorial while learning Kotlin.

I found there are some Array/List confusing me.

  1. What is the different between ArrayList, IntArray and Array<Int>?
  2. When should I use them?
like image 719
Wee Hong Avatar asked Apr 24 '26 04:04

Wee Hong


1 Answers

Major differences

ArrayList : resizable, Generic (Objects)

IntArray : primitive, fix length, only Int values

Array<Int> : Generic (Objects), fix length

like image 54
Pavneet_Singh Avatar answered Apr 25 '26 16:04

Pavneet_Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!