In Java why we write public static void main(String args[])
why not main()?
Answer Posted / ravi
static because once the class is loaded the main() will be
invoked first.
void because main()is not returning any value.
| Is This Answer Correct ? | 228 Yes | 99 No |
Post New Answer View All Answers
How do you sort a string in java?
When the constructor of a class is invoked?
What is replacefirst in java?
What is meant by class loader? How many types are there? When will we use them?
What is nested interface?
What are internal variables?
Explain oops concepts in detail?
What is the use of 'super' keyword inside a constructor?
Why static functions are used?
What is the difference between scrollbar and scrollpane?
What is difference between classpath and path variables in java?
What is difference between variable declaration and definition?
What are the basics of core java?
Can java program run without jre?
Can we change the value of static variable?