Вот сделал вроде, из того что прочитал, в Идее работает, выводит как нужно. А тут не желает, в чем проблема ? Я видимо что-то не так понимаю в своей голове )
package com.javarush.task.pro.task05.task0517;
import java.util.Arrays;
/*
Делим массив
*/
public class Solution {
public static int[][] result = new int[2][];
public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
public static void main(String[] args) {
int[] x = Arrays.copyOfRange(array,0,6);
int[] x2 = Arrays.copyOfRange(array,6,11);
if (array.length%2==0) {
result[1] = Arrays.copyOf(x, x.length);
result[0] = Arrays.copyOf(x2,x2.length);
}
else {
result[0] = Arrays.copyOf(x, x.length);
result[1] = Arrays.copyOf(x2,x2.length);
}
System.out.println(Arrays.deepToString(result));
}
}