Your SlideShare is downloading. ×
D3 Exceptions
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

D3 Exceptions

111
views

Published on

What is exceptions?

What is exceptions?

Published in: Technology, Business

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
111
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Exceptions Pakorn Weecharungsan
  • 2. Contents  What are Exceptions?  The try Statement  The Exception Classes  The catch Cause  The finally Block  Throwing Exceptions
  • 3. What are Exceptions?  An exception is a runtime error in a program. Examples are when a program tries to divide a number by 0.
  • 4. The try Statement
  • 5. The Exception Classes
  • 6. The catch Clause  The catch clause handles exceptions. There are three forms, allowing different le vels of processing
  • 7. The catch Clause
  • 8. The finally Block  If a program’s flow of control enters a try statement that has a finally block, the finally bloc k is always executed  If no exception occurs inside the try block, then at the end of the try block, control skips over any catch claus es and goes to the finally block  If an exception occurs inside the try block, then any appropriate catch clauses in the catch clauses section are executed, followed by execution of the finally bloc k
  • 9. The finally Block
  • 10. Throwing Exceptions  You can make your code explicitly raise an exception by using the throw statement . The syntax for the throw statement is the following
  • 11. Throwing Exceptions

×