0% found this document useful (0 votes)
5 views

Team-9 Exception Handling

Uploaded by

vishal3012006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Team-9 Exception Handling

Uploaded by

vishal3012006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Exception Handling in Java

script
Guru Vishal M
Aniroodh T V
Hari Dharsaun R L
Jayasurya M
Error 404! We didn’t do the presentation. Sorry
:(
Just kidding ;) Here we go!
What is Exception Handling?

Exception handling in Java script is the process of


handling abnormal statements that occur during the
execution of a program.
Exception Handling
Statements
• throw statements
• try...catch statements
• try...catch...finally
statements
Throw Statement
The throw statement throws a user-defined exception.
Execution of the current function will stop (the statements
after throw won't be executed), and control will be passed to
the first catch block in the call stack.

Syntax
Throw Statement
Example
Throw Statement
Output
Try...Catch Statements
A try statement lets you test a block of code for errors. A catch
statement lets you handle that error.

Syntax
Try...Catch Statements
Example Output
Try...Catch...Finally
Statements
Try...Catch...Finally statements works just like Try...Catch
statements and the finally statement defines a code block to
run regardless of the result.

Syntax
Try...Catch...Finally
Statement
Example Output
Sorry sorry...

You might also like