Home > DeveloperSection > Forums > How to convert an Integer array (int[]) into an Integer List (List<Integer>) in Java?
Andrew Deniel
Andrew Deniel

Total Post:29

Posted on    October-05-2013 3:59 AM

 Java Java 

 1 Reply(s)
 1414  View(s)
Rate this:

How do I convert int[] into List<Integer> in Java?

Garry Winogrand
Garry Winogrand

Total Post:24

Posted on    October-05-2013 4:26 AM

    int[] ints = {1, 2, 3};
    List<Integer> intList = new ArrayList<Integer>();
    for (int index = 0; index < ints.length; index++)

Note: - You can use a trick to convert an Integer array to an Integer List.

Don't want to miss updates? Please click the below button!

Follow MindStick