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
What is re-factoring in software?
What is meant by object oriented programming – oop?
Why pointers are not used in java?
Name and explain the types of ways which are used to pass arguments in any function in java.
What is the integer of 16?
What is meant by anonymous class?
What is not object oriented programming?
What are the special characters?
How can we find the sum of two linked lists using stack in java?
Can we override the private methods?
Can you explain inner class.
If an application has multiple classes in it, is it okay to have a main method in more than one class?
Can there be an abstract method without an abstract class?
What is the argument in java?
Why do we need wrapper class?