 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can implement multi-catch in Java. Before starting, you can note my information, you can subscribe my YouTube channel by clicking on the bottom right corner of this video. You can download my app Takimace that is available on Google Play. You can connect with me by following these details which are available in front of you. Coming on to the topic, first let's understand what is multi-catch. So you can read the first point. The multi-catch feature allows two or more exceptions to be caught by the same catch clause. It means a single catch clause can handle more than one exceptions. Second point says, instead of having to catch each exception type individually, you can use a single catch clause to handle all of the exceptions without code duplication. Next point says to use a multi-catch. Separate each exception type in the catch clause with the OR operator. So for separation of exceptions, you have to use this operator. Each multi-catch parameter is implicitly final. And because each multi-catch parameter is implicitly final, it can't be assigned a new value. So this is all about multi-catch theoretically. Now moving to the demonstration. Here you can see a code in Java is written. Name of class is test. Inside test class, main method is defined, which is containing two variables A and B. Value of A is 10 and B is 0. Then wells array, which is initialized with 1, 2, and 3. Then try block is available. Inside try, you can see first statement result equals to A by B. Result of A upon B will be assigned into result variable. Here it can generate an arithmetic exception, which is divided by 0. Then wells tan equals to 19. So it is accessing 10th index, which is not available because array is containing on three elements. So this statement will generate an array index out of bounds exception. So inside this try block, there are possibilities of two exceptions. Now this catch block is containing or handling two exceptions. First is arithmetic exception and second one is array index out of bound exception. With the help of this catch block, we are handling two exceptions and the resultant values will be displayed by this E object. After this catch block, a common statement after multi-catch is available inside system.out.print talent. So if any exception is raised, then also this statement will be displayed. If any exception is not available, then also it will be executed. So now I am saving this code. I am executing this code. You can see the output divide by zero exception is raised. So exception caught java dot length dot arithmetic arithmetic exception divide by zero is displayed here. Then after multi-catch is displayed. So divide by zero exception is handled by this catch block. Now I am commenting this statement and I am hoping that array index out of bound exception will be raised. So this statement is coming now. So this will not execute and control will be directly transferred to this statement which is available at line number seven. So now I am executing code again. You can see exception caught java dot length dot array index out of bounds exception is displayed here and the statement after multi-catch is available. So friends, I hope you have understood the concept that a single catch is handling two exceptions. First one is arithmetic exception and second one is array index out of bounds exception. So this way you can implement multi-catch in your code which is written in java. If you want to watch more programming related videos, you can subscribe my youtube channel. Thank you for watching this video.