Merge 2 Arraylist<Int> in One ArrayList<int>

I have two ArrayList<Int>

And i want a way to merge both of the ArrayList<Int> in 1 new ArrayList<Int>

It’s as simple as:

 val arrayList3 = arrayList1 + arrayList2
2 Likes

i solved it with
arraylist3.addAll(arraylist1)
arraylist3.addAll(arraylist2)
Thank you by the way :slight_smile:

This returns a List , not an ArrayList. I was using this method but I got an List as the type of arrayList3 in your case.