In Java why we write public static void main(String args[])
why not main()?
Answer Posted / sudheer nath
public means the main functiio can be accessible outside the class the jvm remain outside the class so we add the public visiblity mode.
static means the compiler automatically called the main ()functio without creating its instance or object.
void is the return type of the main function means main() does not return any kind of values to its caller means jvm.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is JVM and is it platform independent?
Explain covariant method overriding in java.
Does java isempty check for null?
Differentiate between nested and inner class in java.
How do I convert a string to an int in java?
What is difference between class and object in java?
What is scope & storage allocation of static, local and register variables? Explain with an example.
Can we restart a dead thread in java?
What is %02d?
Why doesn't the java library use a randomized version of quicksort?
What is natural ordering in java?
What is java oops?
What are the Class Libraries ?
How can you share data between two thread in Java?
What are checked exceptions?