1 / 27

Exception Handling In Java | What Is Exception Handling In Java? | Java Tutorial | Simplilearn

This presentation on "Exception Handling in Java" will help you to learn the Java Exceptions Hierarchy and also helps you to learn how to handle various exceptions in java with practical examples.<br><br><br>About Simplilearn Java certification training course:<br>If youu2019re looking to master web application development for virtually any computing platform, this Java Certification Training course is for you. This all-in-one Java training will give you a firm foundation in Java, the most commonly used programming language in software development.<br><br>This advanced Java Certification Training course is designed to guide you through the concepts of Java from introductory techniques to advanced programming skills. The course will provide you with the knowledge of Core Java 8, operators, arrays, loops, methods, and constructors while giving you hands-on experience in JDBC and JUnit framework.<br><br>Java Certification Course Key Features:<br>1. 70 hours of blended training<br>2. Hands-on coding and implementation of two web-based projects<br>3. Includes Hibernate and Spring frameworks<br>4. 35 coding-related exercises on Core Java 8<br>5. Lifetime access to self-paced learning<br>6. Flexibility to choose classes<br><br>Eligibility:<br>Simplilearnu2019s Java Certification Training course is ideal for software developers, web designers, programming enthusiasts, engineering graduates, and students or professionals who wish to become Java developers.<br><br>Pre-requisites:<br>Prior knowledge of Core Java is a prerequisite to taking this advanced Java Certification training course. Our Core Java online self-paced course is available for free to become familiar with the basics of Java programming.<br><br>ud83dudc49Learn more at: https://bit.ly/3b6SCvp

Simplilearn
Download Presentation

Exception Handling In Java | What Is Exception Handling In Java? | Java Tutorial | Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Agenda What is an Exception? What is an Error? Error v/s Exception Exception Hierarchy Checked v/s Unchecked Common Exceptions Exception Handling Best Practices

  2. 01 What is an Exception?

  3. Click here to watch the video

  4. What is an Exception? An exception is an unexpected scenario that pops up during run time and disrupts the normal execution flow a program

  5. 02 What is an Error?

  6. What is an Error? An error is a unexpected even that arises due to logical or syntactical mistake and is capable to bring down the complete program.

  7. 03 Error V/S Exception

  8. Error V/S Exception Exception Error Checked and Unchecked type Unchecked Type Recoverable Irrecoverable Class: java.lang.error Class: java.lang.Exception Run-time and Compile-time Occurs only at Run-time Ex: divideByZero Exception Ex: IO-Error

  9. 04 Exception Hierarchy

  10. Exception Hierarchy Throwable Error Exception JVM Error IO-Exception Memory SQL-Exception Framework ClassNotFound Run-Time Arithmetic NumberFormat

  11. 05 Checked V/S Unchecked

  12. Checked V/S Unchecked Exception An exception that pops up during compile time is called checked exception. It is not serious and ignorable An exception that pops up at run time is called unchecked exception. It is serious and caused by logical errors

  13. 06 Common Exceptions

  14. Common Exceptions ArrayIndexOutOfBound In case, if you try to store a value in the array location which has an address exceeding the array’s maximum location value, this exception is thrown

  15. Common Exceptions NullPointer In case, if you try to perform an operation on a null value, then this exception is thrown

  16. Common Exceptions NumberFormat In case, if you try to store a value with wrong formatting, then this exception is thrown

  17. Common Exceptions Arithmetic In case, if you try to divide a number by zero , this exception is thrown

  18. 07 Exception Keywords

  19. Exception Keywords in Java Method Description Keyword The try key word is used to specify the exception block try The catch keyword is used to specify the solution catch finally The finally keyword has mandatorily executable code The throw keyword throws an exception throw The throws keyword is used to declare exception throws

  20. 08 Best Practices

  21. Best Practices Use Exceptions conservatively Exceptions have proven that they can be costly if used recklessly. Its better we use Boolean values to indicate successful implementation of smaller operations

  22. Best Practices Customized Exceptions It’s a very good practice of customizing your exceptions in the design time rather than planning them on the go

  23. Best Practices Exceptions Logging Keeping track of the exceptions comes handy as the user understands why a particular exception popped up

  24. Best Practices Early Throw and Fail An exception should be thrown as early as possible and should be resolved in the same pace.

  25. Best Practices Closing Resources Since Exceptions halt the complete program, we must make sure the system resources are shut so as to save the resources

More Related