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

Can an application have multiple classes having main method?

877


How do I create an executable jar file?

1017


What if the main method is declared as private?

827


What is optional in java 8? What is the use of optional?advantages of java 8 optional?

874


How do I open the java control panel?

868


What is flatmap java?

924


What is predicate in lambda expression?

774


What if I do not provide the string array as the argument to the method?

860


In hibernate what is the difference between the Session and SessionFactory?

886


Why struts framework is used in java?

865


How does java handle integer overflows and underflows?

971


Explain the common use of ejb?

1044


How many types of jdk are there?

954


What do you understand by numeric promotion?

957


Is jar an executable?

821