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 / kuldeep vishwakarma

We know very well that when we want to call any method without creating Class object in which that method is reside,this will
be perform by "static" keyword.And in java main()always call by JVM,So we can call main()without instance create with the help of jvm.Therefore we needed static with main();
INTERNALLY MAIN()CALL WITH THE HELP OF TRY-CATCH BLOCK

try{
ClassName.main();
}
catch(Exception e)
{
---------------
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are jpa repositories?

892


How do you find lambda?

884


What is java lang noclassdeffounderror?

916


Why do we create dto in java?

947


Which is more secure: java or activex? : java security

937


Can we extract main method from another class?

962


What is a cookie in java?

958


Who created eclipse?

972


What is gui in java with examples?

1040


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

901


What is a stream in programming?

862


How do I install java on windows?

914


What is spliterator in java se 8?

1115


Why oracle type 4 driver is named as oracle thin driver?

856


What is resultsetmetadata in java?

896