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 transient in java?
In java what is the difference between sleep() and wait() .
Topic- looping,function overloading,nesting ,polymorphism. Aim - to write a function with a name buzz-buds,that will check whether the given numbers are buddies or not on the basis of no. of parameters passed during function calling.
What is dto in java?
Explain different way of using thread?
What is ui framework in java?
Why we use beans in java?
What is meant by framework in java?
Is jvm a compiler or an interpreter?
what is reflection api? How are they implemented?
What is the use of jprofiler?
What is setstring method in java?
What are the benefits of a jar file?
What gives java it’s “write once and run anywhere” nature?
What is the difference between Logical Parallelism and Physical Parallelism?