A lot of times I run into stack overflow issues. Use BigInteger and you will not run into stack overflow issues.