Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Meaning of public static void main() in Java

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 180
    Comment on it

    hi friends

    Earlier, i wrote how main method is executed by JVM. Here i have posted, why main() is public static.

    Correct meaning of public static void main()

    public : it is visible to all. (so that main is accessible by JVM & other classes)

    static : without creating instance / object of class, JVM invoke main() with help of class in which main is declared.

    void : it is return type of main(), which return nothing.

    main() : main is name of method designed by compiler designer.

    main is static , because it is entry point of java application. so JVM search the class in which main method in declared & invoke it by class name.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: