In Java why we write public static void main(String args[])
why not main()?
Answer Posted / pandurang d billavar
for execution of class in java is done by creating a object
for methods of that class.so main method is also a class
method.so this method is called by jvm directly without
creating object for main method.it is possible only if main
is static.............so we maked main as static.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the Propertie sof class?
What is meant by vector class, dictionary class, hash table class, and property class?
What is join () in java?
What is indexof?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
what is the purpose of "virtual"?
Is string passed by reference in java?
What are the two parts of a conditional statement?
What is the function of http?
What are the parts of methodology?
What is java literals?
How do I compare two strings in word in java?
Does java linked list allow duplicates?
What is the this keyword?
Can singleton class be inherited in java?