See the code
Integer[] array = (Integer[]) new Object[size];
this obviously do not works, I understand perfectly.
but why with generics works?
T[] array = (T[]) new Object[size];
if T is Integer class, after that line the array will be Object[] type, but why cast is possible? does not throw ClassCastException?
ArrayStoreExceptionat runtime.