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 are the different approaches to implement a function to generate a random number?
What is a dynamic array in java?
What is bom encoding?
What is the difference between hashmap and hashtable in java?
How do you write a scanner class in java?
What are multiple inheritances? Is it supported by java?
Can we instantiate interface in java?
What is the tradeoff between using an unordered array versus an ordered array?
Is null or empty java?
Can an object be null?
How do you check if an arraylist is not empty?
What are the major drawbacks of external iteration?
What are the actions that can occur when a thread enters blocked state?
What is a variable declaration?
What is jrmp?