Here you can find the source of toArray(final T... array)
Parameter | Description |
---|---|
array | the varargs array items, null allowed |
T | the array's element type |
@SafeVarargs public static <T> T[] toArray(final T... array)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . ja va 2 s . co m * Create a type-safe generic array. * * @param array the varargs array items, null allowed * @param <T> the array's element type * @return the array, not null unless a null array is passed in */ @SafeVarargs public static <T> T[] toArray(final T... array) { return array; } }