Adding images to array java -
this question has answer here:
- variable length (dynamic) arrays in java 9 answers
i have array of images created in java, code creates more, id add them created array. methods available add these new images array?
java arrays fixed size; once have array cannot resize it. system.arraycopy()
allows copy contents of array new (potentially larger) array, manual.
the collections api provides number of higher-level data structures more user-friendly arrays, including list
interface defines api similar arrays has many additional features including ability resized, , arraylist
, list
implementation backed arrays under covers.
in short, if need resizable array, want arraylist
.
Comments
Post a Comment