+ 1

I know why should i handle exception.

now something that bothers me why in the world do i need to raise exception. i mean what is the purpose of raising an exception.

13th Apr 2017, 6:59 PM
stephen haokip
stephen haokip - avatar
3 odpowiedzi
+ 6
To know of something unusual has occured in your code and take measures against it or correct what is causing it. It can also be used to alert you in case a specific condition or scenario occurs and you want to send an alert to message.
13th Apr 2017, 7:02 PM
Shraddha
Shraddha - avatar
+ 6
Imagine you are playing an online game. Suddenly your internet cuts off and you will be displayed message like this :- Check your internet connection. What if it is:- Error in java.awt.somestuff.¥yriw784.idjs.hrij.comndos.so cid.zi Well,that doesn't​ help.Hence handling exceptions is a good habit:-)
13th Apr 2017, 8:00 PM
Meharban Singh
Meharban Singh - avatar
+ 1
if something unusual happens. my code will terminate. is not that enough for knowing something is wrong with my code
13th Apr 2017, 7:07 PM
stephen haokip
stephen haokip - avatar