public static Object newInstance(Class<?> cl,int dim){
  return Array.newInstance(cl,dim);
}

public static Object newInstance ( Class < ? > cl , int dim ) { return Array . newInstance ( cl , dim ) ; }
allocate an array dynamically . the array . newinstance method does not throw an error when there is insufficient memory and silently returns a null . throws an outofmemoryerror if insufficient space is available .
