104 |
* @throws NegativeArraySizeException when length is less than 0 |
* @throws NegativeArraySizeException when length is less than 0 |
105 |
* @throws OutOfMemoryError if memory allocation fails |
* @throws OutOfMemoryError if memory allocation fails |
106 |
*/ |
*/ |
107 |
public static Object newInstance(Class componentType, int length) |
public static Object newInstance(Class<?> componentType, int length) |
108 |
{ |
{ |
109 |
if (! componentType.isPrimitive()) |
if (! componentType.isPrimitive()) |
110 |
return createObjectArray(componentType, length); |
return createObjectArray(componentType, length); |
152 |
* than 0 |
* than 0 |
153 |
* @throws OutOfMemoryError if memory allocation fails |
* @throws OutOfMemoryError if memory allocation fails |
154 |
*/ |
*/ |
155 |
public static Object newInstance(Class componentType, int[] dimensions) |
public static Object newInstance(Class<?> componentType, int[] dimensions) |
156 |
{ |
{ |
157 |
if (dimensions.length <= 0) |
if (dimensions.length <= 0) |
158 |
throw new IllegalArgumentException ("Empty dimensions array."); |
throw new IllegalArgumentException ("Empty dimensions array."); |