I came to Java from C++. Both in Java and C++ we have the possibility to specificate exceptions. It looks like this:
void function_name() throw(Exception)
{
...
if (error)
{
throw Exception("Error");
}
...
}
As I know, writing exceptions specification is considered to be a bad practice in C++. Unlike C++, in Java we have to do this. So, my question is:
What's the benefit of writing exceptions specification in Java?