append
Category: Arrays
Author: Stuart Reges
Book Chapter: 7.4
Problem: append
Write a static method called append that takes two integer arrays as parameters and that returns a new array that contains the result of appending the values of the second array at the end of the first array. For example, suppose that arrays list1 and list2 have been declared as follows: int[] list1 = {2, 4, 6}; int[] list2 = {1, 2, 3, 4, 5}; If we make the following call: append(list1, list2) The method will return a new array that contains the following values: [2, 4, 6, 1, 2, 3, 4, 5] If the call instead had been: append(list2, list1) Then the method would return a new array that contains: [1, 2, 3, 4, 5, 2, 4, 6] Your method should not change either of the arrays passed as parameters.