title: How can I increment BigDecimal in java through for loop?
body: <p>How can I increment BigDecimal in java through for loop?
  This is the codes that I am currently running and I don't understand why it won't increment the BigDecimal instances</p>
  
  <pre><code>package app;
  
  import java.math.BigDecimal;
  import java.util.ArrayList;
  import java.util.List;
  
  public class Test {
      private List&lt;BigDecimal&gt; ticketQuantity = new ArrayList&lt;&gt;();
      List&lt;String&gt; someNumber = new ArrayList&lt;&gt;();
  
      public Test() {
  
          ticketQuantity.add(new BigDecimal(0));
          ticketQuantity.add(new BigDecimal(0));
          ticketQuantity.add(new BigDecimal(0));
          ticketQuantity.add(new BigDecimal(0));
  
          someNumber.add("10");
          someNumber.add("10");
          someNumber.add("10");
          someNumber.add("10");
          System.out.println(ticketQuantity);
  
          int i = 0;
          for (BigDecimal x : ticketQuantity) {
              x.add(new BigDecimal(someNumber.get(i)));
              i++;
          }
  
          System.out.println(ticketQuantity);
      }
  
      public static void main(String[] args) {
          new Test();
      }
  }
  </code></pre>
  
  <p>What did I miss? I am hoping that <code>someNumber would equals to [10, 10, 10, 10]</code> but then <code>[0, 0, 0, 0]</code> is printed :(</p>