title: Removing certain values from an arraylist
body: <p>I have a list of numbers from a csv file that I have exported to an ArrayList. Now, the thing is that my ArrayList is in String and not in double. I have tried using </p>
  
  <pre><code>ArrayList&lt;Double&gt; arr = new ArrayList&lt;Double&gt;();`
  </code></pre>
  
  <p>but it gave me an error.</p>
  
  <p>I want to remove any number in the ArrayList that is less than 0.1. Here is my code: </p>
  
  <pre><code>public class Example1
  {
  public static void main(String[] args) throws InvalidFormatException, IOException{
      ArrayList arr=new ArrayList();
  File f=new File("C:\\java\\marchcalllast.csv");
  Scanner in=new Scanner(f).useDelimiter(",");
  
  while(in.hasNext())
  {    
  arr.add(in.next());
  }
  
  
  for (int i = 0; i &lt; arr.size(); i++){
    Double item = Double.valueOf(arr.get(i));
    if (item &lt; 0.1) {
      arr.remove(i);
    }
  }
  System.out.println(arr);
  </code></pre>
  
  <p>It gives me the following error:</p>
  
  <p>Error: no suitable method found for valueOf(java.lang.Object)
      method java.lang.Double.valueOf(double) is not applicable
        (actual argument java.lang.Object cannot be converted to double by method invocation conversion)
      method java.lang.Double.valueOf(java.lang.String) is not applicable
        (actual argument java.lang.Object cannot be converted to java.lang.String by method invocation conversion)</p>