Why do I get a 'cannot find symbol' error in this program? : <p>When I run the following program, I get a 'cannot find symbol' error. It is probably caused by a stupid mistake, but I have spent about an hour trying to fix it and I have no idea what the problem is. Here is the code:</p>

<pre><code>import java.util.*;

public class Purse{

   private ArrayList&lt;String&gt; coins;

   public Purse(){
      coins = new ArrayList&lt;String&gt;();
   }

   public void addCoin(String coin){
      if(coin == "Quarter" || coin == "Dime" || coin == "Nickel")
         coins.add(coin);
   }

   public void removeCoin(String coin){
      coins.remove(coin);
   }

   public void transfer(Purse other){
      for(int i = 0; i &lt; other.coins.size(); i++)
         coins.add(other.coins.get(i));
         other.remove(i);

   }

}
</code></pre>

<p>and here is the error it gives me:</p>

<pre><code>Purse.java:23: error: cannot find symbol
         other.remove(i);
                      ^
  symbol:   variable i
  location: class Purse
1 error
</code></pre>

<p>the program is supposed to be 'moving' items from one ArrayList to another.</p>
