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 is bufferedreader in java?
What is difference between iterator and enumeration in java?
When to use runnable interface vs thread class in java?
What is hashmap and map?
how to run ecllipse with jettyserver for windows environment using batch file
What is difference between iterator access and index access?
Can list be null in java?
What are the uses of java?
Java is pass by value or pass by reference? Explain
How many bits is a double?
What is jvm? How its run?
How many types of string data types are there?
What is multi-catch block in java?
What is meant by polymorphism?
What is array in java?