Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java generic array

public <T> T[] getArray(int size) {
    T[] genericArray = (T[]) new Object[size];
    return genericArray;
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #java #generic #array
ADD COMMENT
Topic
Name
8+4 =