Java Array Create array(T... elems)

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

Description

Shortcut for creating an array of T.

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2007 Bruno Medeiros and other Contributors.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*www. j  a  v  a2s  .  c  om*/
 *     Bruno Medeiros - initial implementation
 *******************************************************************************/

public class Main {
    /** Shortcut for creating an array of T. */
    @SafeVarargs
    public static <T> T[] array(T... elems) {
        return elems;
    }
}

Related

  1. array(Object... val)
  2. array(String str)
  3. array(String... strings)
  4. array(T... ar)
  5. array(T... elements)
  6. array(T... ts)
  7. array(T... values)
  8. array(T... values)
  9. arrayConstructor(int len)