loops - Making ArrayList Size equal to other Array Lists Available in Java -
i have 2 arraylists of varying sizes. example - array1.size() = 10 array2.size() = 5 want @ times these arrays have same size. thus, have class ensure this. obviously, isn't working me. please help! below class code -
for (int = array2.size(); == array1.size(); i++) { array2.add(i, "test"); }
the above loop doesn't add 'test' array2 matches size of array1. ideas guys? please help!
since never equal array1.size(), loop never adds anything
for (int = array2.size(); == array1.size(); i++) { array2.add(i, "test"); }
Comments
Post a Comment