Java Array From toArray(final T... array)

Here you can find the source of toArray(final T... array)

Description

Create a type-safe generic array.

License

Open Source License

Parameter

Parameter Description
array the varargs array items, null allowed
T the array's element type

Return

the array, not null unless a null array is passed in

Declaration

@SafeVarargs
public static <T> T[] toArray(final T... array) 

Method Source Code

//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;
    }
}

Related

  1. toArray(E[] o)
  2. toArray(final double d)
  3. toArray(final int ip)
  4. ToArray(final Object... toSmashIntoArray)
  5. toArray(final String[] strings)
  6. toArray(final T... items)
  7. toArray(final Throwable throwable)
  8. toArray(float[] floatArray)
  9. toArray(int arg1)