Подскажите,пожалуйста, а что не так?
package com.javarush.task.pro.task05.task0504;
/*
Объединяем массивы
*/
import java.util.Arrays;
public class Solution {
public static int[] firstArray = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static int[] secondArray = new int[]{10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
public static int[] resultArray;
public static void main(String[] args) {
int x = firstArray.length + secondArray.length;
resultArray = new int[x];
for (int i = 0; i < 10; i++) {
resultArray[i] = firstArray[i];
}
for (int j = 10; j < 20; j++) {
resultArray[j] = secondArray[j - 10];
}
for (int i = 0; i < resultArray.length; i++) {
System.out.print(resultArray[i] + ", ");
}
}
}
package com.javarush.task.pro.task05.task0504;
/*
Объединяем массивы
*/
import java.util.Arrays;
public class Solution {
public static int[] firstArray = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static int[] secondArray = new int[]{10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
public static int[] resultArray;
public static void main(String[] args) {
int x = firstArray.length+secondArray.length;
resultArray=new int[x];
for (int i = 0; i <10 ; i++) {
resultArray[i]=firstArray[i];
}
for (int i = 10; i <20 ; i++) {
resultArray[i]=secondArray[i-10];
}
for (int i = 0; i < resultArray.length; i++) {
System.out.print(resultArray[i] + ", ");
}
}
}