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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!