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
What is extension method in java?
What is entry set in java?
What is byte data type?
Is the milky way in a void?
How to find the largest value from the given array.
Difference between java and javascript
What is a parameter in matrices?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
Can inner class have constructor?
What is better- service oriented or batch oriented solutions?
What are examples of modifiers?
How many classes can any class inherit java?
What does || mean in vectors?
Can you explain the meaning of aggregation and composition
Is java call by value?