I've come across a situation where I have to perform sum and multiplication of the elements of an ArrayList
and for this normally I use:
sum+=a.get(i)*b.get(i);
which gives me the exact output I want, but here in my case I've got to do the same with ArrayList
of BigInteger
type, I've tried it with the below statement, but it is not working as expected.
sum=(a.get(i).multiply(b.get(i))).add(sum);
please let me know how I can do it.
Thanks.