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 / dadhich

main method is declared as static because we cannot call the method without creating the object of the class.When we declare class and in which if we define main method then it is must to use the static keyword.static keyword helps to execute the main method without instantiating the class.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is custom tag in java?

855


Does jvm maintain a cache by itself? Does the jvm allocate objects in heap? Is this the os heap or the heap maintained by the jvm? Why

826


What is jep in java?

818


What is contextpath in java?

843


What is meant by code profiling?

913


What's a code group? : java security

887


Why dependency injection is used in java?

969


What is the difference between map and flatmap in java?

873


What are jpa repositories?

838


Why do we need framework in java?

792


What is the difference between ec2 and lambda?

826


How long can a lambda function run?

851


Is jvm a compiler or an interpreter?

960


What is profile in java?

840


What is difference between map and flatmap in java 8?

803