In Java why we write public static void main(String args[])
why not main()?
Answer Posted / pandurang d billavar
for execution of class in java is done by creating a object
for methods of that class.so main method is also a class
method.so this method is called by jvm directly without
creating object for main method.it is possible only if main
is static.............so we maked main as static.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is called module?
What is a class reference?
Why string is a class?
What is bifunction in java?
What are different types of references?
What is passing value java?
What is the common usage of serialization?
What are the differences between stringbuffer and stringbuilder?
Is empty .java file name a valid source file name?
Is java se free?
Explain the public class modifier?
How to sort an array from smallest to largest java?
do I need to use synchronized on setvalue(int)? : Java thread
What is the purpose of skeleton and stub?
How does list work in java?