public static void main(string args[]) Explanation

In Above application we are using public static void main. Each word has different meaning and different purpose.

Public : It is an Access Modifier, which(AM) defines who can access this method(In Java World). Public means that this method will be accessible to any class(If other class can access this class.).

Static : Keyword which identifies the class related this. It means that this class is not instance related but class related. It can be accessed without creating the instance of Class.

Void : Return Type, It defined what this method can return. Which is void in this case it means that this method will not return any thing.

main: Name of the method. This method name is searched by JVM as starting point for an application.

String args[] :  Parameter to main method.

Me & Jayshree Singh. Main brain behind this blog/QnA site. We have written all these article as per my personal experience. I have published it mainly to help. These articles might have some problems. So bear with me and let me know if you find any problem in any of the article. You can find me on

5 comments

  1. Gaurang   •  

    Please fix your grammatical errors. It makes understanding this content difficult.

  2. Akash Dhande   •  

    Hello Sir ,
    Nice Info wanted to ask what are the parameters does main method takes
    thanku

  3. Jay   •  

    String args[] : Parameter to main method…

    Please site how to use the main() with values given to parameters (like what the difference would be with (or without) these values).

    • naresh   •  

      If u dont use it shows error in execution….that y we r passing infinite arguments in String type…string is one.type of class ….so,first letter is capital

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">