In Java why we write public static void main(String args[])
why not main()?
Answer Posted / sai kiran varma
In java main() is a default calling funtion.
first main() function is called.
As we dont no what value it returns we use void keyword for it.
only static methods can be called using class names so we
declare static.
only public methods can be accessed from any where so,we use
public..
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
why are there separate wait and sleep methods? : Java thread
Can we force the garbage collection to run?
What is the difference between the prefix and postfix forms of the ++ operator?
What is difference between null and void?
What is parsing a string?
What is JVM and is it platform independent?
Why java is said to be pass-by-value ?
How does linkedlist work in java?
Why java is platform independent? Explain.
List the three steps for creating an object for a class?
What is unicode used for?
Is java util list serializable?
What causes memory leak in java?
What does sizeof return?
What is an interface in java?