Java Array Create array(String... strings)

Here you can find the source of array(String... strings)

Description

Returns an array of strings from the supplied var-args.

License

Apache License

Parameter

Parameter Description
strings Zero or more strings

Return

String ; may be of length zero

Declaration

public static String[] array(String... strings) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from w ww  .  ja v a 2 s .  c  o  m*/
     * Returns an array of strings from the supplied var-args.
     *
     * @param strings Zero or more strings
     * @return {@code String}; may be of length zero
     */
    public static String[] array(String... strings) {
        if (strings == null)
            return new String[0];
        String[] ret = new String[strings.length];
        for (int i = 0; i < strings.length; ret[i] = strings[i], i++)
            ;
        return ret;
    }
}

Related

  1. array(int... values)
  2. array(int[] array, int index)
  3. array(Object... objects)
  4. array(Object... val)
  5. array(String str)
  6. array(T... ar)
  7. array(T... elements)
  8. array(T... elems)
  9. array(T... ts)