 Hello friends, I am Saja Gupta. I welcome you on my channel. You can watch various programming related videos on my channel So you can search it. You can subscribe it for updates. You can watch more than 800 videos You can search those videos with the help of Tivo programming by Sanjay Gupta on YouTube. In this video I am going to demonstrate you Why main is static in Java? So you might have used main method in each code of Java and you have used static keyword with this main method And you might be thinking why we are using static every time with main method So I have implemented this test class. It is containing main method and this system.out.println So first execute this It is working properly without Providing or giving any error. Now I am removing static keyword You can see it is compiled successfully But at the time of execution it is providing an error that main method is not static in class test Please define the main method as public static void main. So This error you might have seen if you have removed static from main and this is because of this reason Main is called by JVM automatically So you can say if the program is containing one or more than one classes There should be a entry point. So main is the entry entry point Or you can say it is the beginning of execution So there must be a method which will begin the execution of the program So in case of Java it is main and if main is defined in a particular class Then you have to create object of that class Then you can call that particular method because if a method is defined in a particular class Then you can call that method With the help of that object But you cannot create object of this class because it is the entry point That's why there's a feature If you can't create object of a particular class you can make its method as static So that they can be called without creation of any object So like if I create one more class Test one And if I define any particular method here like this So if I want to call this some method so I can create object of test one like this And I can call some method like this. So test one object is created in test class And some method is called through this ob object in test class, but After test class I can't define another test class because test is containing main which is the beginning of execution so There is a problem that Willingly or unwillingly I can't create object of test class into another class because main is the beginning point So that's why there's a spatial feature which is known as static method And static keyword which is available with main so that it can call without creating any object in Java And it is called by jvm automatically. So if we having these two classes test one and test So first this main will be called automatically and then main will be calling some method using this object So there's a reason Why we are using static keyword always with main method So I hope you have understood now why we are using static keyword with main method every time in java I hope you have understood whatever I have demonstrated you in this video If you want to watch more programming related videos, you can search the keyword program by sanjay gotha on youtube Thank you for watching this video