public static Object newInstance(Class<?> cl,int[] dims){
  if (dims.length == 0) {
    dims=new int[]{1};
  }
  return Array.newInstance(cl,dims);
}

public static Object newInstance ( Class < ? > cl , int [ ] dims ) { if ( dims . length == 0 ) { dims = new int [ ] { 1 } ; } return Array . newInstance ( cl , dims ) ; }
allocate an array dynamically . the array . newinstance method does not throw an error and silently returns a null . throws an outofmemoryerror if insufficient space is available .
