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:
- lists have better support generics arrays (you can, , should, read in "effective java" bloch - see item 25)
- if ask using arraylist vs. implementing - find hard believe you'll better job guys developed in openjdk (josh bloch , neal gafter).
Comments
Post a Comment