What is the need to declare main() method as static in Java?
Answer Posted / kuldeep vishwakarma
We know very well that when we want to call any method without creating Class object in which that method is reside,this will
be perform by "static" keyword.And in java main()always call by JVM,So we can call main()without instance create with the help of jvm.Therefore we needed static with main();
INTERNALLY MAIN()CALL WITH THE HELP OF TRY-CATCH BLOCK
try{
ClassName.main();
}
catch(Exception e)
{
---------------
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is difference between loosely coupled and tightly coupled in java?
What is an api in java?
What is resultsetmetadata in java?
What is lambda used for?
What is transactional in java?
What is the difference between the boolean & operator and the && operator?
How do you type the lambda symbol?
What is stateful in java?
What is transient in java?
What is data encapsulation?
What is ibatis in java?
What's a code group? : java security
What is the difference between Logical Parallelism and Physical Parallelism?
I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance
What are messages in java?