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


3 Answers

diptiman roy Profile
diptiman roy answered
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.
vellal subhash Profile
vellal subhash answered
The main method in java is static. As we compile the program it starts compilation from main only. Object cannot be created for main method.
john caleb Profile
john caleb answered
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

Answer Question