Throwing Exceptions
Hi all,
I am try'n to throw an exception if the arguments for this codes produces a value out of the int range but it is not working need help
codes:
public static int mult(int x, int y) {
if (x == 0 || y == 0) {
return 0;
} else if((x * y)<= Integer.MAX_VALUE){
return (mult(x, (y - 1)) + x);
}
throw new IllegalArgumentException("Value " + x + " Or " + y
+ " is not a natural number or cannot"
+ " produce a value in the int range");

