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

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -