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
Why does java doesnt suuport unsigned values?
How do you use compareto in java?
Give reasons supporting that string is immutable.
What is skeleton and stub?
How do you format in java?
What is meant by class?
What is threaded programming and when is it used? : Java thread
What is the tradeoff between using an unordered array versus an ordered array?
What are serialization and deserialization?
Is upper case in java?
What is "this" keyword in java? Explain
Is there any difference between nested classes and inner classes?
What does string [] args mean?
What is the purpose of declaring a variable as final?
what is the major difference between linkedlist and arraylist in java?