In Java why we write public static void main(String args[])
why not main()?
Answer Posted / xyz
Public -> Because we want to access the main from the out side of the class generally when we run the java program at that time it call the main method.
Static ->Because it will create only one copy of main method and we can call with class name so when we run program it will
run main method using passed program name like name.main();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Under what conditions is an object’s finalize() method invoked by the garbage collector?
Does java support Operator Overloading?
What is the use of coding?
What is the purpose of finalization in java programming?
Can private method static?
What is independent and dependent variables in research?
What is variable and constant explain with example?
What are the important methods of java exception class?
Is there any case when finally will not be executed?
What does nextint () do in java?
What is string [] java?
Can we sort a map in java?
What is nested class?
How many bytes is a unicode character?
What is the difference between iterator and list iterator?