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
How can a gui component handle its own events in java programming?
What is runtime locatable code?
Write a program to print all permutations of string?
What are the advantages and disadvantages of object cloning?
What is numeric function?
Where is jre installed?
How many arguments can a method have java?
What is the super void?
Can we declare an interface as final?
What Is Composition?
What is difference between equal and == in java?
What is the static import?
What do you understand by the term string pool?
Can a static class implement an interface?
Is singleton set an interval?