SlideShare a Scribd company logo
1 of 6
TYPE OF EXCEPTIONS
Chapter 9.4:
Objectives
 After you have read and studied this
chapter, you should be able to
 Improve the reliability of code by
incorporating exception-handling.
 Implement the try-catch blocks for catching
and handling exceptions.
 Write methods that propagate exceptions.
 Distinguish the checked and unchecked, or
runtime, exceptions.
Checked vs. Unchecked Exception
 There are two types of exceptions:
 Checked.
 Unchecked.
 A checked exception is an exception that is
checked at compile time, so it must be
handled.
 An unchecked exception is not checked at
compile time, so no need to handle
(optional).
 unchecked exception include Error and
RuntimeException and their subclasses.
 checked exception include Exception and
its subclasses.
Different Handling Rules
 When calling a method that can throw
checked exceptions
 use the try-catch statement and place the call
in the try block, or
 modify the method header to include the
appropriate throws clause.
 When calling a method that can throw
runtime exceptions, it is optional to use the
try-catch statement or modify the method
header to include a throws clause.
Handling Checked
Exceptions
Handling Runtime
Exceptions

More Related Content

What's hot (7)

Control statements
Control statementsControl statements
Control statements
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
Java unit 11
Java unit 11Java unit 11
Java unit 11
 
Select case
Select caseSelect case
Select case
 
Decision making
Decision makingDecision making
Decision making
 
Vb decision making statements
Vb decision making statementsVb decision making statements
Vb decision making statements
 
Exception
ExceptionException
Exception
 

Viewers also liked

Chapter 9.1
Chapter 9.1Chapter 9.1
Chapter 9.1sotlsoc
 
Chapter 3.4
Chapter 3.4Chapter 3.4
Chapter 3.4sotlsoc
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
Chapter 3.1
Chapter 3.1Chapter 3.1
Chapter 3.1sotlsoc
 
Chapter 5.1
Chapter 5.1Chapter 5.1
Chapter 5.1sotlsoc
 
Chapter 11.2
Chapter 11.2Chapter 11.2
Chapter 11.2sotlsoc
 
Chapter 2.2
Chapter 2.2Chapter 2.2
Chapter 2.2sotlsoc
 
Chapter 10.3
Chapter 10.3Chapter 10.3
Chapter 10.3sotlsoc
 
Chapter 8.2
Chapter 8.2Chapter 8.2
Chapter 8.2sotlsoc
 
Chapter 10.1
Chapter 10.1Chapter 10.1
Chapter 10.1sotlsoc
 
Chapter 7.4
Chapter 7.4Chapter 7.4
Chapter 7.4sotlsoc
 
Chapter 1.0 new
Chapter 1.0 newChapter 1.0 new
Chapter 1.0 newsotlsoc
 
Chapter 6.1
Chapter 6.1Chapter 6.1
Chapter 6.1sotlsoc
 
Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4sotlsoc
 
Chapter 8.0
Chapter 8.0Chapter 8.0
Chapter 8.0sotlsoc
 
Chapter 5.0
Chapter 5.0Chapter 5.0
Chapter 5.0sotlsoc
 
Chapter 9.2
Chapter 9.2Chapter 9.2
Chapter 9.2sotlsoc
 
Chapter 9.0
Chapter 9.0Chapter 9.0
Chapter 9.0sotlsoc
 
Chapter 1.2
Chapter 1.2Chapter 1.2
Chapter 1.2sotlsoc
 

Viewers also liked (19)

Chapter 9.1
Chapter 9.1Chapter 9.1
Chapter 9.1
 
Chapter 3.4
Chapter 3.4Chapter 3.4
Chapter 3.4
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
Chapter 3.1
Chapter 3.1Chapter 3.1
Chapter 3.1
 
Chapter 5.1
Chapter 5.1Chapter 5.1
Chapter 5.1
 
Chapter 11.2
Chapter 11.2Chapter 11.2
Chapter 11.2
 
Chapter 2.2
Chapter 2.2Chapter 2.2
Chapter 2.2
 
Chapter 10.3
Chapter 10.3Chapter 10.3
Chapter 10.3
 
Chapter 8.2
Chapter 8.2Chapter 8.2
Chapter 8.2
 
Chapter 10.1
Chapter 10.1Chapter 10.1
Chapter 10.1
 
Chapter 7.4
Chapter 7.4Chapter 7.4
Chapter 7.4
 
Chapter 1.0 new
Chapter 1.0 newChapter 1.0 new
Chapter 1.0 new
 
Chapter 6.1
Chapter 6.1Chapter 6.1
Chapter 6.1
 
Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4
 
Chapter 8.0
Chapter 8.0Chapter 8.0
Chapter 8.0
 
Chapter 5.0
Chapter 5.0Chapter 5.0
Chapter 5.0
 
Chapter 9.2
Chapter 9.2Chapter 9.2
Chapter 9.2
 
Chapter 9.0
Chapter 9.0Chapter 9.0
Chapter 9.0
 
Chapter 1.2
Chapter 1.2Chapter 1.2
Chapter 1.2
 

Similar to Chapter 9.4

Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdf
Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdfException Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdf
Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdfRamirezCarl
 
Multi catch statement
Multi catch statementMulti catch statement
Multi catch statementmyrajendra
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptionsmyrajendra
 
Exception Handling In Java
Exception Handling In JavaException Handling In Java
Exception Handling In Javaparag
 
UNIT III 2021R.pptx
UNIT III 2021R.pptxUNIT III 2021R.pptx
UNIT III 2021R.pptxRDeepa9
 
UNIT III 2021R.pptx
UNIT III 2021R.pptxUNIT III 2021R.pptx
UNIT III 2021R.pptxRDeepa9
 
Java Exceptions and Exception Handling
 Java  Exceptions and Exception Handling Java  Exceptions and Exception Handling
Java Exceptions and Exception HandlingMaqdamYasir
 
Python Programming - X. Exception Handling and Assertions
Python Programming - X. Exception Handling and AssertionsPython Programming - X. Exception Handling and Assertions
Python Programming - X. Exception Handling and AssertionsRanel Padon
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in JavaJava2Blog
 
VTU MCA 2022 JAVA Exceeption Handling.docx
VTU MCA  2022 JAVA Exceeption Handling.docxVTU MCA  2022 JAVA Exceeption Handling.docx
VTU MCA 2022 JAVA Exceeption Handling.docxPoornima E.G.
 
Ch-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allCh-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allHayomeTakele
 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#Muhammad Younis
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyRaghavendra Kamath
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javapriyankazope
 

Similar to Chapter 9.4 (20)

Javasession4
Javasession4Javasession4
Javasession4
 
Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdf
Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdfException Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdf
Exception Handling_ Mastering the Art of Dealing with Errors and Exceptions.pdf
 
SUBHASH.pptx
SUBHASH.pptxSUBHASH.pptx
SUBHASH.pptx
 
Multi catch statement
Multi catch statementMulti catch statement
Multi catch statement
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptions
 
Exception Handling In Java
Exception Handling In JavaException Handling In Java
Exception Handling In Java
 
OCAJP 8
OCAJP 8OCAJP 8
OCAJP 8
 
31 days Refactoring
31 days Refactoring31 days Refactoring
31 days Refactoring
 
UNIT III 2021R.pptx
UNIT III 2021R.pptxUNIT III 2021R.pptx
UNIT III 2021R.pptx
 
UNIT III 2021R.pptx
UNIT III 2021R.pptxUNIT III 2021R.pptx
UNIT III 2021R.pptx
 
Java Exceptions and Exception Handling
 Java  Exceptions and Exception Handling Java  Exceptions and Exception Handling
Java Exceptions and Exception Handling
 
Java chapter 6
Java chapter 6Java chapter 6
Java chapter 6
 
Python Programming - X. Exception Handling and Assertions
Python Programming - X. Exception Handling and AssertionsPython Programming - X. Exception Handling and Assertions
Python Programming - X. Exception Handling and Assertions
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
VTU MCA 2022 JAVA Exceeption Handling.docx
VTU MCA  2022 JAVA Exceeption Handling.docxVTU MCA  2022 JAVA Exceeption Handling.docx
VTU MCA 2022 JAVA Exceeption Handling.docx
 
Ch-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for allCh-1_5.pdf this is java tutorials for all
Ch-1_5.pdf this is java tutorials for all
 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
 
Exception handling in .net
Exception handling in .netException handling in .net
Exception handling in .net
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 

More from sotlsoc

Chapter 2.0 new
Chapter 2.0 newChapter 2.0 new
Chapter 2.0 newsotlsoc
 
Chapter 3.0 new
Chapter 3.0 newChapter 3.0 new
Chapter 3.0 newsotlsoc
 
Chapter 6.5 new
Chapter 6.5 newChapter 6.5 new
Chapter 6.5 newsotlsoc
 
Chapter 11.1
Chapter 11.1Chapter 11.1
Chapter 11.1sotlsoc
 
Chapter 11.3
Chapter 11.3Chapter 11.3
Chapter 11.3sotlsoc
 
Chapter 11.0
Chapter 11.0Chapter 11.0
Chapter 11.0sotlsoc
 
Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2sotlsoc
 
Chapter 10.0
Chapter 10.0Chapter 10.0
Chapter 10.0sotlsoc
 
Chapter 9.3
Chapter 9.3Chapter 9.3
Chapter 9.3sotlsoc
 
Chapter 8.1
Chapter 8.1Chapter 8.1
Chapter 8.1sotlsoc
 
Chapter 8.3
Chapter 8.3Chapter 8.3
Chapter 8.3sotlsoc
 
Chapter 5.2
Chapter 5.2Chapter 5.2
Chapter 5.2sotlsoc
 
Chapter 7.3
Chapter 7.3Chapter 7.3
Chapter 7.3sotlsoc
 
Chapter 7.2
Chapter 7.2Chapter 7.2
Chapter 7.2sotlsoc
 
Chapter 7.1
Chapter 7.1Chapter 7.1
Chapter 7.1sotlsoc
 
Chapter 7.0
Chapter 7.0 Chapter 7.0
Chapter 7.0 sotlsoc
 
Chapter 6.6
Chapter 6.6Chapter 6.6
Chapter 6.6sotlsoc
 
Chapter 6.5
Chapter 6.5Chapter 6.5
Chapter 6.5sotlsoc
 

More from sotlsoc (18)

Chapter 2.0 new
Chapter 2.0 newChapter 2.0 new
Chapter 2.0 new
 
Chapter 3.0 new
Chapter 3.0 newChapter 3.0 new
Chapter 3.0 new
 
Chapter 6.5 new
Chapter 6.5 newChapter 6.5 new
Chapter 6.5 new
 
Chapter 11.1
Chapter 11.1Chapter 11.1
Chapter 11.1
 
Chapter 11.3
Chapter 11.3Chapter 11.3
Chapter 11.3
 
Chapter 11.0
Chapter 11.0Chapter 11.0
Chapter 11.0
 
Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2
 
Chapter 10.0
Chapter 10.0Chapter 10.0
Chapter 10.0
 
Chapter 9.3
Chapter 9.3Chapter 9.3
Chapter 9.3
 
Chapter 8.1
Chapter 8.1Chapter 8.1
Chapter 8.1
 
Chapter 8.3
Chapter 8.3Chapter 8.3
Chapter 8.3
 
Chapter 5.2
Chapter 5.2Chapter 5.2
Chapter 5.2
 
Chapter 7.3
Chapter 7.3Chapter 7.3
Chapter 7.3
 
Chapter 7.2
Chapter 7.2Chapter 7.2
Chapter 7.2
 
Chapter 7.1
Chapter 7.1Chapter 7.1
Chapter 7.1
 
Chapter 7.0
Chapter 7.0 Chapter 7.0
Chapter 7.0
 
Chapter 6.6
Chapter 6.6Chapter 6.6
Chapter 6.6
 
Chapter 6.5
Chapter 6.5Chapter 6.5
Chapter 6.5
 

Recently uploaded

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 

Recently uploaded (20)

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 

Chapter 9.4

  • 2. Objectives  After you have read and studied this chapter, you should be able to  Improve the reliability of code by incorporating exception-handling.  Implement the try-catch blocks for catching and handling exceptions.  Write methods that propagate exceptions.  Distinguish the checked and unchecked, or runtime, exceptions.
  • 3. Checked vs. Unchecked Exception  There are two types of exceptions:  Checked.  Unchecked.  A checked exception is an exception that is checked at compile time, so it must be handled.  An unchecked exception is not checked at compile time, so no need to handle (optional).  unchecked exception include Error and RuntimeException and their subclasses.  checked exception include Exception and its subclasses.
  • 4. Different Handling Rules  When calling a method that can throw checked exceptions  use the try-catch statement and place the call in the try block, or  modify the method header to include the appropriate throws clause.  When calling a method that can throw runtime exceptions, it is optional to use the try-catch statement or modify the method header to include a throws clause.