Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

generics in java

public <T> List<T> fromArrayToList(T[] a) {   
    return Arrays.stream(a).collect(Collectors.toList());
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #generics #java
ADD COMMENT
Topic
Name
6+1 =