title: Using a list for BigInteger addition
body: <p>I am implementing my own BigInteger class using an ArrayList and am unsure how to write my addition method.</p>
  
  <pre><code>public BigInt plus(BigInt operand){
      //deep copy?
      ArrayList&lt;Byte&gt; a = this.digit;
      ArrayList&lt;Byte&gt; b = operand.digit;
      ArrayList&lt;Byte&gt; sum = new ArrayList&lt;&gt;();
  
      //code  
  
      return new BigInt();
  }
  </code></pre>
  
  <p>The goal is to pass in another BigInt, take its Arraylist of bytes and add it to the Arraylist of bytes of the current BigInt, but when doing this, if the value of adding 2 bytes together you would carry the '1' and add it to the next byte in the list. </p>
  
  <p>IE: </p>
  
  <pre><code>BigInt1 = "3,2,1,7"
  
  BigInt2 = "1,4,3,5"
  </code></pre>
  
  <p>Adding 7 and 5 would create 12, so the 1 is carried and 2 will be in that index for the returned BigInt.</p>
  
  <p>The final BigInt should be </p>
  
  <pre><code>BigIntSum = "4,6,5,2"
  </code></pre>
  
  <p>My question is, how can I iterate through these lists, add the bytes and carry a number if necessary, and add that? Any help is greatly appreciated. BigInt has a constructor that can take a string that is turned into its own ArrayList</p>