Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why do we need main method to execute a java program?



Why do we need main method to execute a java program?..

Answer / javamasque

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

Post New Answer

More Core Java Interview Questions

How is it possible for two string objects with identical values not to be equal under the == operator?

0 Answers  


What are thread safe functions?

0 Answers  


What state does a thread enter when it terminates its processing in java programming?

0 Answers  


What is compile time polymorphism?

20 Answers   CTS, Elementus Technologies, Oracle,


Can we overload run() method in java?

0 Answers  


What is JAVA? Why it is platform independent?

10 Answers   NIIT,


What is the difference between member variables initialization and assignment in a constructor?

0 Answers   Hexaware, Virtusa,


What is the abstract class?

0 Answers  


How we get some middle records in one table?

2 Answers   3i Infotech,


Is java ee a framework?

0 Answers  


Can we add default constructor to Servlet?

1 Answers   Fidelity,


What is the functionality of Webserver?

2 Answers  


Categories