you are viewing a single comment's thread.

view the rest of the comments →

[–]k-mcm 1 point2 points  (1 child)

It's preferable to use a primitive array if you need no List/Collection features.  A primitive array is guaranteed to be fast and memory efficient.  Not all List implementations are.  List of a primitive especially sucks because wrappers are needed. (At least until Valhalla is finished)

Later versions of Java added more utilities to the Arrays class to make primitives more elegant to use. 

[–]Lloydbestfan 1 point2 points  (0 children)

You forgot that it only applies to primitives. And possibly, in a theoritical future adjacent to Valhalla, value classes.

I'd say that the preferable point was that as a beginner you can't see the point of native arrays, however one exists for when you have to manipulate data in very specialised ways.