Question
You are given 2 different arrays of the same size that are filled with numbers. Write a method that joins these two arrays together. Every
You are given 2 different arrays of the same size that are filled with numbers. Write a method that joins these two arrays together. Every item from the first array should be the first half of your new array, and every item of the second array should be the second half of your new array. Here is a sample program to test your code: in eclipse (java)
public class Problem06 {
public static void main(String[] args) {
int[] firstArray = {1,2,3,4,5};
int[] secondArray = {6,7,8,9,10};
int[] result = joinArrays(firstArray, secondArray);
for (int i = 0; i < result.length; i++) {
System.out.print(result[i] + " ");
}
}
public static int[] joinArrays(int[] firstArray, int[] secondArray){
// Your code here
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started