In public static void main (), static means
In public static void main (), static means main () is a class method and can be called without creating an object.
Public:- it is an access specifier that means it will be accessed by publically.
Static:- it is access modifier that means when the java program is load then it will create the space in memory automatically.
Void:- it is a return type that is it does not return any value.
main():- it is a method or a function name.
A main method is static because it is available to run when your program starts and as it is the entry point of the program it runs without creating an instance of the class. In other words, static functions exist before a class is instantiated so static is applied to the main entry point
Main method has to be declared static because keyword static allows main to be called without creating an object of the class in which the main method is defined.