In Java why we write public static void main(String args[])
why not main()?
Answer Posted / kedar
static methods can be accessed without creating object object of class, we know that file name of java program is "classname.java", "classname" is the class which contain main function, so it is easier for compiler to locate class which contain main(), and because of static nature it can execute it.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the main method java?
Which access specifier can be used with class ?
What is stringreader?
What do you mean by an object in java?
what is optional in java 8?
make a method which any number and any type of argument and print sum of that arguments.....
What is the meaning of 3 dots in java?
what is mutual exclusion? : Java thread
What is the purpose of java?
Difference between association, composition and aggregation?
What does .equals do in java?
Which is the best sorting technique in java?
What is the advantage of OOP in java?
What ide should I use for java?
Can we write a class without main method in java?