In Java some types has limited range. For example int is between -2 147 483 648 and 2 147 483 647. So if I do something like this:
int z = 24*100000000; System.out.println(z);I will get -1894967296 which is of wrong. Is there anyway to implement anykind of exceptions for that? Is there any other way then casting to long and checking number range? And what about the situation if I'm already working with long types.
Thanks in advance!


Sign In
Create Account


Back to top









