Which of the following parts of the code will not cause the compilation errors?
Explanation
The handler for the general type exceptions should not precede others or the exception will be caught and and their code will never be executed.
The blocks try, catch, and finally cannot be separated by any expressions including blank instruction.
If handled exception is not raised anywhere within the try block, then, the catch block in the handled exception is not executed as well.
However Exception any controlled exception is at the same time the parent of uncontrolled exception RuntimeException (and all the exceptions that inherit from it). Compiler assumes that an uncontrolled exception may always occur and, therefore, Exception handler is achievable.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты