Add short comments which describes this code
static intsafeAdd(int left, int right)
{
if (right <0) {
if(left >Integer.MAX_VALUE – right) {
throw newArithmeticException(“Integer overflow”);
}
}
else {
if (left <Integer.MIN_VALUE – right) {
throw newArithmeticException(“Integer overflow”);
}
}
return left +right;
}
Expert Answer
An answer will be send to you shortly. . . . .