Why declare Main() method as a static in java ?
Answer / Prakhar Narain
In Java, the main() method must be declared as static because it is used to start the execution of the program without creating an object of the class. The JVM invokes the main() method when the program starts.
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the difference between cd & dvd ?
30 Answers Lovely Professional University, Satyam, Sibylsys,
What will be the default values of all the elements of an array defined as an instance variable?
How does final modifier work?
What is the meaning of course?
What are actual parameters?
Can a class be private or protected in java?
What is append function?
Why are inner classes required?
Why we use static and synchronized in method for single thread model example: public static synchronized add(){}
What are interfaces?
Explain cookies?
java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.