Home TechnologyProgrammingJava Subscribe to RSS

Why Cant I Create An Object For Main Method In Java?

Answer Question

2 Answers - Sort by: Date | Rating

    The main method is a static method in java.  Remember its syntax?  Well its P Static V M. so when you execute a java program the main function is called automatically.  Hence there is no need to create an object to call it
    0 0

    John_caleb  

    answered 3 years ago

      The main method is a static method.That's why it is not a property of any particular object. It's the property of entire class. The execution of Java application program starts from main.
      That's the answer.
      0 0

      Diptiman  

      answered 3 years ago

        More

        More

           
           

          Ask a Question via Twitter

          Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

          Blurtit Store

          Get T-shirts, hoodies, caps and more at the Blurtit store

          Blurtit International