 Hello friends, I am Sanjay Gupta. In this video, I am going to explain you the concept of exception handling in Java. Before starting, you can note my information. You can subscribe my YouTube channel by clicking on the link which is available at bottom right corner of this video. You can download my app Takimiz that is available on Google Play. You can connect with me by following these details which are available in front of you. Now coming on to the topic, you can see some points which are available in front of you which belongs to exception handling. So first point says an exception is an indication of a problem that occurs during a program's execution. Second point says exception handling enables programmers to create applications that can resolve or handle exceptions. So friends, exceptions are run time errors which can terminate execution of your program in between. So you can resolve this problem by applying exception handling in Java. Third point says in many cases handling an exception allows a program to continue execution as if no problem has been encountered. Fourth point says a more severe problem could prevent a program from continuing normal execution instead requiring it to notify the user about the problem before terminating in a controlled manner. Last point says this feature enables programmers to write robust and fault tolerant programs that is programs that are able to deal with problems that may arise and continue execution. So I hope you have understood the meaning of exception. Exception means any error that can occur during execution of the program. You can handle that error and you can show an error message to the user so that that error can be handled properly and you can implement robust or fault tolerant programs. In continuation, next point, a Java exception is an object that describes an exceptional condition that is an error that has occurred in a piece of code. When an exception condition arises, an object representing that exception is created and thrown in the method that causes the error. Next point says that method may choose to handle the exception itself or it can pass it on. The exception is caught and processed. Exception can be generated by the Java runtime system or they can be manually generated by your code. So exception can be generated automatically by Java runtime system or you can manually create exceptions so that you can control your code. Java exception handling is managed via five keywords which are trial, catch, throw, throws and finally. So with the help of these five keywords you can implement exception handling in Java. Now you can see Java exception hierarchy here to top most classes throwable which is further inherited by exception and error classes. Exception is further inherited in runtime exception and IO exception and runtime exception is inherited by array index out of bound input mismatch exception, class cast exception, null pointer exception, arithmetic exception. Then error is inherited by awt error, thread depth and out of memory error. So this is the simple Java exception hierarchy that we can use to handle exceptions occurs in Java code. Now there's an explanation regarding that chart which I have shown you. Here first point says all exception types are subclasses of the built-in class throwable. Thus throwable is at the top of the exception class hierarchy. Next point says immediately below throwable are two subclasses that partition exceptions into two distinct branches. One branch is headed by exception. This class is used for exception, exceptional conditions that user program should catch. This is also the class that you will inherit in subclasses to create your own custom exception types. Next point says there is an important subclass of exception called runtime exception. Exceptions of this type are automatically defined for the programs that you write and include things such as division by zero and invalid array indexing. Other branches is headed by error which defines exceptions that are not expected to be caught under normal circumstances by your program. Stack overflow is an example of such an error. So friends, this way throwable class is further divided into two parts. First one is exception and second one is error. So exception can be handled whereas error cannot be handled. Exception is further divided into subclasses and further those subclasses which are subclasses of exception further divided into various subclasses. So this is the complete hierarchy of exception handling in Java. If you want to watch how exception handling is implemented in Java, you can watch my further video which is available in the playlist. That video will show you how you can implement exception handling in Java. If you want to watch more programming related videos, you can subscribe my YouTube channel. You can connect with me by following my details. Thank you for watching this video.