Java Exception handling and its keyword - PowerPoint PPT Presentation

About This Presentation
Title:

Java Exception handling and its keyword

Description:

Java Exception handling and its keyword – PowerPoint PPT presentation

Number of Views:116

less

Transcript and Presenter's Notes

Title: Java Exception handling and its keyword


1
Java Exception Handling and Its Useful Keywords
2
  • Exception handling is a process to handle
    exceptions in the execution of the program at run
    time so that the execution should not stop. The
    advantage of exception handling is to maintain
    the execution of the program/code because
    generally, exception stops the execution of the
    program.
  • Exception in Java are as below-
  • 1.Checked Exception
  • 2.Unchecked Exception

3
Below are some Keywords that are used to handle
exceptions In Java-
  • 1.Try- It is a block of code where users write
    code that could have any exception. This block is
    always followed either by a catch block or
    finally block, we cannot use try block alone.
  • 2.Catch- In this block code is written to handle
    the exception. Catch block is never written alone
    it is always preceded by the try block, and also
    catch block could be followed by a finally block.
  • 3.Finally- This block of code is used to execute
    the crucial code of the program, it is executed
    when an exception is handled or not handled.
  • 4.Throw- This keyword is used to throw the
    exception.
  • 5.Throws- This keyword is used to declare the
    exception, it signifies that this method can
    throw an exception. We will always write this
    keyword with the method signature.

4
  • A programmer should always handle the exception
    to maintain the normal execution of the program
    because an exception can disrupt the normal flow
    of the execution of the code that's why we should
    use exception handling.
  • At Oodles ERP, we provide full-scale enterprise
    application development services to efficiently
    manage diverse business operations. Our custom
    mobile and web application development services
    are conducive to increasing business productivity
    and improving operational efficiency. For more
    information, contact us at erp_at_oodlestechnologies.
    com.
Write a Comment
User Comments (0)
About PowerShow.com