how to concatenate all the elements in arraylist in java code example Example: java arraylist concat array1.addAll(array2);