Actually you can use,
BigInteger sum= new BigInteger("12345");
for creating object for BigInteger class.But the problem here is,you cannot give a variable in the double quotes.So we have to use the valueOf() method and we have to store the answer in that sum again.So we will write,
sum= sum.add(BigInteger.valueOf(i));