Java Array Create arrayOf(int... values)

Here you can find the source of arrayOf(int... values)

Description

Generates an int[] from comma-separated values.

License

Open Source License

Parameter

Parameter Description
values Comma-separated int values

Return

int[]

Declaration

public static int[] arrayOf(int... values) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2016 Pablo Pavon-Marino.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 *
 * Contributors:/*from   w  w w . ja  v  a2 s  .c om*/
 *     Pablo Pavon-Marino - Jose-Luis Izquierdo-Zaragoza, up to version 0.3.1
 *     Pablo Pavon-Marino - from version 0.4.0 onwards
 ******************************************************************************/

public class Main {
    /**
     * Generates an {@code int[]} from comma-separated values.
     *
     * @param values Comma-separated {@code int} values
     * @return {@code int[]}
     */
    public static int[] arrayOf(int... values) {
        return values;
    }
}

Related

  1. array(T... elems)
  2. array(T... ts)
  3. array(T... values)
  4. array(T... values)
  5. arrayConstructor(int len)
  6. arrayOf(long... values)
  7. arrayOf(T... elements)
  8. arrayOf(T... objects)
  9. ArrayToArray(Integer obj, Integer[] objArray)