I am looking to take two int[] arrays, and concatenate them into a single one. I realize that there are quite a few posts already on here, yet all of them are using more advanced scripts (System.arraycopy, etc.) that I am not familiar with. I could easily use them, but I lose understanding for why I am using these methods.
My plan looking forward is to set both my arrays to Strings (using the toString() method), and then trace them with a for loop. Each time an integer is found, it prints it onto the end of a new String that is originally initialized to "".
Example (line breaks for spacing):
array1 = [1, 2, 3, 4];
array2 = [5, 6, 7];
array3 = [1, 2, 3, 4, 5, 6, 7]; //this is what array should look like.
Can anyone offer me any advice on my proposed method to fulfilling this part of my work?
(Student)from question header/title. It's not needed.arraycopythen do it manually. Create a 3rd array with size arr1+arr2 and then loop through both array and store their contents to arr3.