Android ArrayList Create toList(T only)

Here you can find the source of toList(T only)

Description

to List

License

Open Source License

Declaration

public static <T> List<T> toList(T only) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static <T> List<T> toList(T only) {
        ArrayList<T> result = new ArrayList<T>();
        result.add(only);/*from w  w w  . j  a v a  2  s.com*/
        return result;
    }
}

Related

  1. newArrayList( final Collection collection)
  2. newArrayList()
  3. newArrayList()
  4. newArrayList(final int initialCapacity)