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 a delimiter in java?

876


Why do we only use the main method to start a program?

1018


How can the static main method use instance variables?

980


Do I really have to type in the programs in the book to try them out?

999


If you’re overriding the method equals() of an object, which other method you might also consider?

936


What is use of jpa?

848


Write a program using call by refernce for two different classes to explain to print whether a given number is automorphic or not.

1865


Is java singleton thread safe?

868


Name primitive java types.

908


What is dto layer in java?

868


What is the difference between a jvm and a jdk?

1001


Why doesn’t the main method throw an error with no arguments?

927


What is ui framework in java?

890


Which framework is best for rest api java?

967


What are struts java?

893