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 the front end for java?
How do you find lambda?
Why is struts used in java?
In hibernate what is the difference between the Session and SessionFactory?
What is the difference between a while statement and a do statement?
Write a class which checks whether a given number is prime or not. Write another class to implement the behavior of previous class and print the series of twin prime number upto a given range.
What is gpt and gpc? : java security
Why is javac not recognized?
What is dto in java?
Do I need jdk or jre?
What is profile in java?
What is the most important feature of java?
How do I open the java console in windows 10?
Which framework is best for rest api java?
What is the difference between Logical Parallelism and Physical Parallelism?