In Java why we write public static void main(String args[])
why not main()?
Answer Posted / amardip sabale
we write public static void main() because
public:for access of main function all over the program
static:main is also one type of method,and for calling this
method while running our program without creation of any
object
void:because it is not return anything
String args[]:because when we run our program then always
we pass at least two command line arguments(java and
program name)for collecting them we have to write it
*THANKS*
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What happens when a thrown exception is not handled?
How to solve the problem of generating the unique hash keys with hash function?
What is an i/o filter?
What do you mean by stream pipelining in java 8?
What modifiers are allowed for methods in an interface?
What is the significance of java packages?
Why strings in java are called as immutable?
What is byte value?
What does substring mean?
What is one third plus one third as a fraction?
How many arguments can a method have java?
What are the different http methods?
What a static class can contains?
When can an object reference be cast to an interface reference in java programming?
Can we overload the methods by making them static?