Explanation of public static void main in Java
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHHQhmktIDF9Nzhh1ITKYkgunRvL1lj5-lN1GK7fjYD7cWnuKF9WyRAJjJo56vgvxt4V75vpMUE0Q5gvGeI3GmuGtYbllFKd6bcectGmN6UDAw9ELuRNd91vhV5zrVMLT8L5RbowcW_mY/w501-h257/wap.png)
In java , we have encountered a most common syntax many times which is something like this- We all have written this code when we are first introduced with java. But , most of us are unaware about what this codes says. What is the use of public static void main() and why it is always written like this , no matter how much the length of code. Its format is still the same. Lets try to understand this one by one - public - This public keyword is an access modifier. Now , what access modifier is ? It is used to help to know who can access the method or variable. There are 4 types of access modifiers - public , protected, private and default. This main method is declared as public so that we JVM can invoke it outside of the class and evryone can access it to provide output. If it is changed to any other modifier then JVM would not be able to access it and main method will not invoked by it causing error that - main class not found. static- It is also a keyword which helps main me...