Java List Create createList(String s)

Here you can find the source of createList(String s)

Description

Creates a new List of String and adds s to it

License

Apache License

Parameter

Parameter Description
s a parameter

Declaration

public static List<String> createList(String s) 

Method Source Code

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

import java.util.ArrayList;
import java.util.List;

public class Main {
    /**//from  w w  w .j a  va 2  s  . c om
     * Creates a new {@link List<?>} of {@link String} and adds <i>s</i> to it
     * @param s
     * @return
     */
    public static List<String> createList(String s) {
        List<String> result = new ArrayList<String>();
        result.add(s);
        return result;
    }
}

Related

  1. createList(final T... elements)
  2. createList(List list)
  3. createList(Object... entries)
  4. createList(Object... objs)
  5. createList(Object[] values)
  6. createList(T value, int n)
  7. createList(T... _entries)
  8. createList(T... array)
  9. createList(T... element)