Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Answers Viewqa Java-Beginners Why is the main method declared static?

View Questions and Answers by Category


Have Programming Question? Ask it here!

Java Coder
Why is the main method declared static?
1 Answer(s)      a year and 10 months ago
Posted in : Java Beginners


Why is the main method declared static?


View Answers

April 11, 2013 at 11:50 AM


When we declare main() method in any Java class always has the same signature, and we declare public static void main(String args[]. The motive of it is that static in JVM can call it directly without creating any instance for the java class, where we declared it. Any static java method can be called without having to instantiate in the class that defines the static method.

For more visit

Related Tutorials/Questions & Answers: