Java Array to List toList(int[] array)

Here you can find the source of toList(int[] array)

Description

Wandelt ein int-Array in eine Integer-Liste um.

License

Open Source License

Parameter

Parameter Description
array Das umzuwandelnde Array

Return

Die Integer-Liste

Declaration

public static List<Integer> toList(int[] array) 

Method Source Code


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

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

public class Main {
    /**// w w w  .j  a v  a2s .c  om
     * Wandelt ein int-Array in eine Integer-Liste um.
     * 
     * @param array Das umzuwandelnde Array
     * @return Die Integer-Liste
     * 
     * @see ArrayHelper#toArray(List) Integer-Liste zu int-Array
     */
    public static List<Integer> toList(int[] array) {
        List<Integer> list = new ArrayList<Integer>();
        for (int value : array)
            list.add(value);
        return list;
    }
}

Related

  1. toList(final T[] array)
  2. toList(final T[] array)
  3. toList(final T[] array)
  4. toList(int[] a)
  5. toList(int[] arr)
  6. toList(int[] array)
  7. toList(int[] from)
  8. toList(Object[] arr)
  9. toList(Object[] array)