В консоль выводит все правильно, но 4 пункт не принимает
Вроде все решила правильно, программа все стыкует, но 4 пункт выдает ошибку) Конечно, может, мое решение просто не принимает. Ибо просмотрев вопросы других, у всех в основе через if else выполняется данная задача.
Подскажите, в чем ошибка, где что не так?
package com.javarush.task.pro.task05.task0504;
/*
Объединяем массивы
*/
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[] resultArray = new int[firstArray.length + secondArray.length];
int res = 0;
for (int one = 0; one < firstArray.length; one++) {
resultArray[one] = firstArray[one];
res++;
}
for (int two = 0; two < secondArray.length; two++) {
resultArray[res++] = secondArray[two];
}
for (int i = 0; i < resultArray.length; i++) {
System.out.print(resultArray[i] + ", ");
}
}
}