Q:

is unsafe to copy a three-dimensional array using Arraylist?

I wonder if can I copy a 3-dimensional array, using ArrayList<>() as a middle step.
Please, consider the following code:
        /*variable declaration*/
        int[][][] array;
        int[][][] array2;
        ArrayList<int[][][]> list;
        ArrayList<int[][][]> list2;

        /*initialization*/
        array = new int[10][12][14];
        list = new ArrayList<>();

        list.add(array);

        //Construct 'list2', using all the elements contained in 'list'
        list2 = new ArrayList(list);

        array2 = list2.get(0);

I wonder if array2 is a complete copy (deep copy) of array, or is array2 a reference to array (points to same object in memory).
Also, is this an unsafe operation? 

A:

Both val and val2 point to the same object in memory even after you've cloned the first list into the second.
You can prove this with:
System.out.println(val == val2);

prints "true"
That said, note that when you pass a collection to the ArrayList copy constructor all it does is simply construct a list containing the elements of the specified collection so I am not sure why you expected it to perform some type of "deep copying"

