Question: Write a java method merge that accepts two arrays of integers and returns a new array containing all elements of the first array followed by
Write a java method merge that accepts two arrays of integers and returns a new array containing all elements of the first array followed by all elements of the second.
int[] a1 = {12, 34, 56};
int[] a2 = {7, 8, 9, 10};
int[] a3 = merge(a1, a2);
System.out.println(Arrays.toString(a3));
// [12, 34, 56, 7, 8, 9, 10]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
