+ 3

Java arrays are always fixed size?

Maybe i'm a bit confused, because i was learning javascript first, but it seems waay too complicated with java arrays? why is that so, I have no idea... importing some extra stuff, just so we could manipulate the size of an array, seems crazy... is there a good reason for this?

9th Mar 2018, 10:42 AM
Nikola Djekic
Nikola Djekic - avatar
4 ответов
+ 6
yes that's why it's called IMMUTABLE,once an array in java is declared,the system sets a specific amount of memory for it,this cannot be changed,so use ArrayList
9th Mar 2018, 12:20 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 4
For a non-fixed array, use is usually ArrayList, LinkedList.
9th Mar 2018, 11:48 AM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 3
nice, thanks! I really like the community here, one could learn a lot just reading the comments
9th Mar 2018, 12:24 PM
Nikola Djekic
Nikola Djekic - avatar
+ 2
got it, thanks :)
9th Mar 2018, 11:51 AM
Nikola Djekic
Nikola Djekic - avatar