R
(1) No. If it's an exception, we either catch it at some level or our program goes out.
But when we caught him, we can check him with other means. For example, if (exc instanceof IOException) ... But usually in practice, it's rare when you need it.(2) Yeah, whatever it is, it'll throw that exception away or we'll do it. We can do this:try {
throw new Exception();
} catch (Exception e) {
// Этот код будет выполнятся всегда.
}
But it's not recommended that, because it's against the ideal of exceptions. If we can process a mistake at the current level (though we're in the current function) we're not throwing an exception, but we're in the process. As a consequence, it is better to use if instead of try - catch, because a large number of processing loads the programme, and exemptions are handled at a very slow pace.By the way, the second paragraph, you could've checked yourself, what was the problem of writing such a code and seeing whether it would fly out or not?