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...

What is the need to declare main() method as static in Java?

Answer Posted / bsridhar1984

main() is the entry point of the java program for JVM. If it
is not static and have to call main method, JVM has to
create the object for that class. At this situation
constructor of that class will be entry point.

So that main() method of that class should be static. Then
only JVM can access the main method directly without
creating object of the program.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java lang?

820


Can we install jre without jdk?

843


What is gpt and gpc? : java security

942


What is @override annotation in java?

889


Can a dead thread be started again?

1034


What is stateless class in java?

883


What is use of jpa?

805


Is java built on c?

880


Define network programming?

981


What is hql in java?

820


How do I enable java in firefox?

1007


Are streams faster than for loops?

853


What is meant by rest api in java?

885


What is the use of servlet in java?

891


What is static class in java?

964