title: Convert character to BigInteger
body: <p>I know there is quite all of posts for converting characters to integers, strings to <code>BigInteger</code>-s, <code>int</code>-s to <code>BigInteger</code>-s, ... but I just can't figure out why this does not work.</p>
  
  <pre><code>Scanner sc = new Scanner(System.in);
  
  BigInteger sum = 0;
  String line = "";
  while (sc.hasNext()) {
  line = sc.next();
  for (char character: vrstica.toCharArray()) {
      sum = sum.add(BigInteger.valueOf(Character.getNumericValue(character)));
      }
  }
  </code></pre>
  
  <p>I do have <code>Scanner</code> and <code>BigInteger</code> imported. The input data is constructed of lines with numbers, like this: 7218904932283439201\n7218904932283439201 ...</p>
  
  <p>If I understand correctly, addition for <code>BigInteger</code>-s should be written like this: <code>bigInteger1.add(bigInteger2)</code>, where both numbers are of type <code>BigInteger</code>. So I should convert that character of type <code>char</code> to type <code>int</code> and then convert that <code>int</code> value to <code>BigInteger</code> with method <code>BigInteger.valueOf()</code>, which takes an <code>int</code> argument. </p>
  
  <p>The error I am getting is the following: <code>incompatible types: int cannot be converted to BigInteger</code></p>
  
  <p>I am not seeing where I could be wrong so I would appreciate if anyone could point out my mistake.</p>