What is the need to declare main() method as static in Java?

Answer Posted / s. devanand

In Java, we call any method and variable without creating an
object of the class. Hence we declare main method as static
without creating an object we call the main method.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stateless object in java?

700


What is cloning in java?

708


What if I write static public void instead of public static void?

675


What is cdi in java?

682


What does jpa mean?

696


What is a yaml file in java?

683


What is difference between map and flatmap in java 8?

662


In system.out.println(), what is system, out and println?

807


When do we go for java 8 stream api? Why do we need to use java 8 stream api in our projects?

772


What is lambda used for?

675


What is maven in java?

656


What is java api?

661


What is @override annotation in java?

701


What is interceptor in java?

662


What is web container in java?

731