java arrays.mismatch code example Example: java ArrayList toArray type mismatch MyClass[] array = arrayList.toArray(new MyClass[arrayList.size()]);