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 |
What are the object and class classes used for?
What is the difference between variable declaration and variable initialization?
What is class variable java?
can we write two same methods in outer class and innerclass.
suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare that class as abstract then can we call only two methods to give the deinition of that method & i don't want to give the definition of all the methods? can it possible
State some advantages of java?
How does callback work in java?
Do I need java on my computer?
What is the function of compareto in java?
What is the vector class in java programming?
How use .contains in java?
What is Marker interface in java? and what is clone?