Exception Handling in Java | Core Java Concepts Tutorials

This Core Java Concepts Tutorials”Exception Handling in Java” is providing introduction to exception handling including compile time errors, logical errors and runtime errors in java application.


 

Exception Handling:

  • During program Compilation and Execution there is a chance to get 3 kinds of Errors

 

Compile time errors:

  • Every language is having syntactical rules.
  • While defining instruction set, we must follow these rules.
  • Violation of syntax rules gives compile time errors.
  • for example..
    1. Every method should have return type
    2. ‘this’ cannot be used in static context
    3. abstract & final cannot be combined

Logical errors:

  • Logical error is the not compiler error and run time error.
  • It produces unexpected output when we run the application.

Runtime errors:

  • Violation of JVM rules.
  • Runtime error is called Exception.
  • As a programmer, we need to analyze the errors which will occur while application is running.
  • As a programmer we can write the logic but that executes only in case of Exception at runtime.

Types of Errors in Java

 

Exception Causes….

  1. Abnormal termination of program.
  2. Informal information to End user.
  3. Improper shutdown of Resources.

Exception causes…..

 

Share this