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

Java prints out a ton of digits when I system.out.println() a double. How can I format it so it displays only 3 digits after the decimal place?

645


What is an entity in java?

671


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

651


What is mime in java?

681


What is javax annotation generated?

655


What is meant by java se?

695


What is aop in java?

674


What is interceptor in java?

652


What is an interceptor in java?

635


Can we install jre without jdk?

683


What is web xml java?

675


Why do we need new date and time api in java se 8?

666


What is the difference between lambda expression and anonymous methods?

662


What is meant by annotations in java?

683


What is property file in java?

650