I think there are 2 ways to deal with overflow.
check if you are ABOUT to overflow before adding:
if (result == Integer.MAX_VALUE/10 && x%10 > Integer.MAX_VALUE%10)
if (result > Integer.MAX_VALUE/10)
trickier way, declare 'result' as long, and check if exceeds Integer.MAX_VALUE. Just remember to cast back to int when returning.
Any other options?