Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How main method internally executed by JVM ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 443
    Comment on it

    Hi friends,

    As we know that , if we declare user define method as static, then there is no need to create object of class. We can call method with the help of class name.

    Syntax for calling the static method: CLASSNAME.METHODNAME().

    Similarly, The main method of java is call by CLASSNAME with the help of JVM.

    For Example.

    Class Hello
    {
     static void display();
          {
                 System.out.print("Static method call by Hello");
          }
    }
    Class MainClass
    {
    public static void main()
              {
                    System.out.print("main method");
              }
    }
    

    In the above example, JVM call the main method by classname in which main method is declared.

    Internally, JVM invokes main() by "MainClass.main()".

 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: