java - Array vs ArrayList: Dynamic Use -


both arraylists , vectors make use of typical arrays internally. however, leaves me thinking... why use arraylists when can technically same thing using arrays? convenience reason? performance-critical applications ever make use of arraylist?

any tips appreciated.

i believe there multiple reasons prefer lists on "implementing lists on arrays" or on "using arrays", here 2 think important:

  1. lists have better support generics arrays (you can, , should, read in "effective java" bloch - see item 25)
  2. if ask using arraylist vs. implementing - find hard believe you'll better job guys developed in openjdk (josh bloch , neal gafter).

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -