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
Can a singleton class be inherited?
How do you add an arraylist to an array in java?
What is the set interface in java programming?
Can we have return statement in finally clause? What will happen?
What are the two environment variables that must be set in order to run any java programs?
What is oop in java?
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
How can I become a good programmer?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
What is singletonlist in java?
What is the purpose of main function in java?
What is the full form of jpeg?
Can a class be declared as static?
Which java ide is used the most?
What is hashset in java?