What is the need to declare main() method as static in Java?
Answer Posted / dadhich
main method is declared as static because we cannot call the method without creating the object of the class.When we declare class and in which if we define main method then it is must to use the static keyword.static keyword helps to execute the main method without instantiating the class.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is microservices java?
What is the point of lambda expressions?
Who created eclipse?
What is a driver in java?
How do I enable java in google chrome?
What is the locale class?
How do I install java on windows?
How can you work with permissions from your .net application? : java security
what is reflection api? How are they implemented?
What is a static method?
What is transaction management in java?
How does jpa repository work?
What is ehcache in java?
What is meant by framework in java?
Why do we need framework in java?