posted 18 years ago
Piyali:
Yes, basically:
Of course, the code above is a bit silly; Throwables include Errors as well, not just Exceptions, so it may not be useful to catch them. Also, ArithmeticException is a runtime exception (descendant of RuntimeException), so it is not required to declare it in the method header. But doing so is a good idea, because the user of your API will get a better overview of what's happening.