Answer the question
In order to leave comments, you need to log in
Why is it necessary to rethrow exceptions?
Do I understand correctly that repeated exceptions take us to a higher level? But to a higher level of what if it still remains at the Exception level?
catch(Exception e){
System.err.println("Было возбуждено исключение");
throw e;
}
Answer the question
In order to leave comments, you need to log in
Rethrowing an exception allows your code to react to the exception, not to swallow it, but to forward it to the calling code so that it can also react to it somehow.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question