 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use Throws Clause 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 Takimist that is available on Google Play. You can connect with me by following these details which are available in front of you. Now coming onto the topic, first I am going to explain you what is Throws Clause or Throws Statement. So first point says, if a method is capable of causing an exception that it doesn't handle. It must specify this behavior so that callers of the method can guard themselves against that exception. You do this by including a Throws Clause in the methods declaration. Hence if a method doesn't want or it is not capable to handle any exception then it can throw or it can transfer control from that function to the caller function so that caller function can handle that exception. This you can done with the help of Throws Clause. A Throws Clause lists the type of exceptions that method might throw. This is necessary for all exceptions except those of the error or runtime exception or any of their subclasses. So if you are facing any error or if you are using runtime exception class or any of their subclasses then it is not necessary otherwise in all other exceptions it is necessary to throw any exception that a method doesn't want to handle. You can follow this syntax. Here this is type, return type, then method name, then parameter list and then you have to use a keyword Throws and then you can specify the exception list. Inside curly basis you can define body of the method. Here exception list is a comma separated list of the exceptions that a method can throw. So this is all about a Throws Clause. Now I am going to demonstrate you the use of Throws Clause with the help of an example. Here you can see I have implemented two classes. First one is Throws demo and second one is test. Inside Throws demo I have implemented a method throw one which is throwing illegal access exception. So friends here I am using Throws Clause and it will throw illegal access exception. Inside this method system.out.println will print inside throw one masses then this throw keyword will create sorry this throw keyword will throw an object which is created by a new legal access exception. So if you want to throw an exception then you have to create an object of that particular type. So here with the help of new a nameless object will be created and throw keyword will throw that object to the caller method. Now inside test class main method is defined. Inside main method between try a block throws demo dot throw one this statement is written. So throw one is a method which is called with the help of class name throw one is a static method. As you can see throw one is a static method. So there is no need to create an object. We can call it by using name of the class. So throw one is called by main method control will be transferred to its definition then it will print inside throw one masses and then an object will be thrown with the help of throw keyword. So if you are using throw keyword then necessarily you have to define throws clause so that an exception can be transferred to its caller method. So throw one is called by main so control will be transferred to main and here using try and catch we have handled illegal access exception and the thrown object will be received by this object e here with the help of system dot out dot print lm values of e will be displayed on console. Now I am executing this code. You can see the output inside throw one is displayed here and caught masses and Java dot lang dot illegal access exception demo is printed here. It is printed through this statement which is available in catch. So friends if you want to throw an exception from a method to its caller method so that that method don't have to catch or handle that exception it will be handled by the caller method. You can use throws clause and in support you can use throw keyword. This is all about throws clause. You can implement this demonstration in your system so that you can understand the concept well. If you want to watch more programming related videos you can subscribe my YouTube channel. Thank you for watching this video.