Duplicate :
|
|
Relates :
|
|
Relates :
|
An API is needed to be able to create array classes. A method can be added to java.lang.Class: public Class getArrayType(int dimensions); It would return a Class class for the array of that class with the appropriate number of dimensions. If applied to an Array class it would return a Class an array with a number of dimensions equal to the existing array class plus the dimensions specified. If applied to any of the primitive types it should create the appropriately typed array. This method is a campanion to Class.getComponentType. Related methods for reflecting upon arrays in in java.lang.reflect.Array.
|