Try catch block | Sololearn: Learn to code for FREE!


Try catch block

Why doesn't the try catch block catch this exception?.... shouldn't it catch all exceptions?

10/21/2020 11:10:43 AM

Sheldon 10110

4 Answers

New Answer


Because the compiler catch it first. catch will catch exceptions at runtime.


Why is this?


Just search for the difference between compile errors and runtime errors and you will find an answer.


Aaaaah I hadn't seen the runtime part...thanks... I get it now