Posts

Showing posts from April, 2020

Exception handling in java programming

Image
Exception handling in java with examples By-Er. Ratnesh Kumar Mishra  Exception handling is one of the most important feature of java programming that allows us to handle the runtime errors caused by exceptions. In this guide, we will learn what is an exception, types of it, exception classes and how to handle exceptions in java with examples. What is an exception ?  An Exception is an unwanted event that interrupts the normal flow of the program. When an exception occurs program execution gets terminated. In such cases we get a system generated error message. The good thing about exceptions is that they can be handled in Java.  Why an exception occurs? There can be several reasons that can cause a program to throw exception. For example: Opening a non-existing file in your program, Network connection problem, bad input data provided by user etc. Exception Handling If an exception occurs, which has not been handled by programmer then program ex...