Why do we need main method to execute a java program?
Main method is auto called by JVM. It is the place, where JVM enters into the class. It is called before the class is instantiated by its constructor. There are below reasons on its signature.
1. Public access modifier: it is visible to outer environment called JVM.
2. Static non-access modifier: it is called before the class is instantiated, hence JVM use class name to call the main method.
3. Void return type: It return no value to JVM.
4. String array parameter: It takes command line arguments.
| Is This Answer Correct ? | 11 Yes | 1 No |
Which is the class in java?
Write POJO class as a key to hashmap???
Does java map allow duplicates?
Name some classes present in java.util.regex package.
When we can access the static data member without creating the object what is the need of the object in java.
5 Answers Airhub, ssinformatics,
What are the advantages of compiled language?
How does marker interface provides functionality to the implemented class ? or How dose maker interface gets the functionalities as serialization or cloning.
Is there any difference between synchronized methods and synchronized statements?
What is casting?
Is java developer a good career?
What is object english?
what us Dyna action form?
4 Answers Aithent Technologies,