title: Converting from int array to Integer arraylist in java
body: <p>I have a problem in converting from Array to ArrayList</p>
  
  <pre><code>public class one 
  {
  public static void main(String args[])
  {
  int y[]={12,25,38,46};
  two p=new two();
  p.setLocations(y);
  }
  }
  
  
  import java.io.*;
  import java.util.*;   
  
  public class two 
  {
      ArrayList&lt;Integer&gt; data_array=new ArrayList&lt;Integer&gt;();
  
  
  void setLocations(int locations[])
  {
          ArrayList&lt;Integer&gt; locations_arraylist=new ArrayList(Arrays.asList(locations));
          data_array=locations_arraylist;
      for(int i=0;i&lt;data_array.size();i++)
          System.out.println("data_array["+i+"]="+data_array.get(i));
  }
  }
  </code></pre>
  
  <p>In the below line </p>
  
  <pre><code>ArrayList&lt;Integer&gt; locations_arraylist=new  ArrayList(Arrays.asList(locations));
  //Copying from array to ArrayList-Its converting,Please suggest
  </code></pre>