Java List from Array arrayToList(Object[] arr)

Here you can find the source of arrayToList(Object[] arr)

Description

array To List

License

Apache License

Declaration

public static List<?> arrayToList(Object[] arr) 

Method Source Code


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

import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

public class Main {

    public static List<?> arrayToList(Object[] arr) {
        List<?> list = new ArrayList<>();
        if (arr == null) {
            return list;
        }/* ww w . ja  v a  2 s .co  m*/
        list = Arrays.asList(arr);
        return list;
    }
}

Related

  1. arrayToList(int[] array)
  2. arrayToList(int[] array)
  3. arrayToList(Object arr[], int from, int length)
  4. arrayToList(Object data)
  5. arrayToList(Object data[])
  6. arrayToList(Object[] hyCycles)
  7. arrayToList(String[] array, String... defaults)
  8. arrayToList(String[] arrValues)
  9. ArrayToList(String[] input)