+ 4

Error vs Exception

What is the difference between Error and Exception? .There are doubts I need to clarify like 1.Most articles mention that error is unchecked in nature and yet syntax error is detected during compilation 2.Also mentioned that error is not recoverable in nature then how come runtime errors can be handled using try catch block?

8th May 2022, 9:21 AM
notstacked
3 Antworten
+ 2
Adding.. Errors are 2 types basically Errors and Exceptions. Errors are those which can't handled by program like hardware errors.. Exception are run time errors, again 2 types checked and unchecked . Checked exceptions are determined at compile time but unchecked are detectable at compile time. Syntax errors are deferent to these runtime errors.. those are compile time errors.. Hope it helps..
8th May 2022, 12:28 PM
Jayakrishna 🇮🇳
+ 5
Main difference is: Error comes at compile time Exception comes at run time.
8th May 2022, 9:50 AM
A͢J
A͢J - avatar
+ 2
Thank you so much A͢J and Jayakrishna🇮🇳
8th May 2022, 5:43 PM
notstacked