+ 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.
3 ответов
+ 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.
+ 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:-)
+ 1
if something unusual happens.
my code will terminate. is not that enough for knowing something is wrong with my code