newArray method (format 1)

Description

Directly creates an array instance of the length specified in the parameter length of the class that is specified in the parameter type of the Explicit memory block indicated by the object.

Format

public Object newArray(Class type,  int length);

Parameters

type:
This parameter specifies the class of the array instance to be created directly.
length:
This parameter specifies the length of the array instance to be created directly.

Exceptions

NullPointerException:
The parameter type is null.
NegativeArraySizeException:
The parameter length is 0 or less than 0.
IllegalArgumentException:
An array class for which the parameter length is more than 0 and the parameter type is more than 255 dimensions or the array class having the type Void.TYPE.
InaccessibleMemoryAreaException:
This functionality is not supported.

Return value

This method directly creates an array of the type type in the Explicit memory block indicated by the object, and then returns the reference. The length of the array is as specified in length.

If it is judged that processing cannot be executed by performing the common error check, invoke java.lang.reflect.Array.newInstance(Class<?>,componentType,int length) by the parameter type and parameter length, and return that result. For details on common error check, see 10.6 Error check (common error check) of the process that controls the Explicit memory block .