Java Program: Take 2 arrays, write a method to - Insert array2 in to array1 at given position
//Output: {12, 13,14,5,6,15}
package qasign;
import java.util.ArrayList;
import java.util.Arrays;
public class SampleTest {
public static void main(String[] args) {
Integer array1[]={12, 13,14,15};
Integer array2[]={5, 6};
int position=3;
List<Integer> list1=new ArrayList<>(Arrays.asList(array1));
System.out.println();
Arrays.asList(array2);
List<Integer> list2=new ArrayList<>(Arrays.asList(array2));
list1.addAll(position, list2);
System.out.println(list1);
}
}