Blogger

Delete comment from: Javarevisited

Anonymous said...

Another solution would be to use BigInteger:

public static int add(int a, int b) {
BigInteger i = BigInteger.valueOf(a);
BigInteger j = BigInteger.valueOf(b);
BigInteger sum = i.add(j);
return sum.intValue();
}

Jun 18, 2013, 11:15:34 AM


Posted to How to Add Two Integer Numbers without using Plus + or ++ Arithmetic Operator in Java - Recursion example

Google apps
Main menu