com.jdroid.java.collections.ObjectArrays Maven / Gradle / Ivy
package com.jdroid.java.collections;
import java.lang.reflect.Array;
public class ObjectArrays {
/**
* Returns a new array of the given length with the specified component type.
*
* @param type the component type
* @param length the length of the new array
* @return an Array
*/
@SuppressWarnings("unchecked")
public static T[] newArray(Class type, int length) {
return (T[])Array.newInstance(type, length);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy