In Java why we write public static void main(String args[])
why not main()?
Answer Posted / deependra prarap singh
in the java when we creat any of the class then the "java's compiler after entering in the class ,
fistly search for the static because the java's compiler know every thing about the static
and then java's compiler search for the main method,
as we know that the main is a method then there should be some return type so we use void because it has no return type
after declaring the void now we use the public because we are to access the main method from any where or outside
"
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Which containers use a flowlayout as their default layout in java programming?
What are green threads in java?
What are the advantages of defining packages in java?
What is predicate in java?
How do you find the absolute value?
How do you sort words in java?
Explain about public and private access specifiers?
Can java cast null?
What are the two ways of implementing multi-threading in java?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What does a method signature consist of?
Why is java called java?
What are packages in java?
What ide should I use for java?
What are Normalization Rules? Define Normalization?