Computer Science, asked by RishabhRDX, 1 year ago

Are EXCEPTIONS and RUNTIME errors same things in JAVA? If no, what is the difference? If yes, what is the similarity?

Answers

Answered by chaitanyakrishn1
1
No there are not the same thing.

Error in a program is an abnormal condition or a serious problem that cannot be recoveres from and hence not be handled. 
The occurence of an error results in termination of program. 

Runtime errors are precisely the unforeseen errors which can be identified and results in termination of program.
Like dividing an int value by 0.

Exceptions are abnormal conditions arising during execution of the program from which it may be possible to recover and should be handled by the program before it lets itself terminate.

If exception is handled properly, termination of program does not occur.

Thank u ★ ★ ★
#ckc

RishabhRDX: but dividing a number by 0 is an exception exception as well as a runtime error
RishabhRDX: I got it... thanks
RishabhRDX: an exception is an event caused at runtime... but is not a runtime error
chaitanyakrishn1: Yes u r right
chaitanyakrishn1: This is a similarity. They both are encountered at the time of execution
Similar questions