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?

Answers were Sorted based on User's Feedback



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

Answer / juhi

If main method is static it should not be able to access any
other methods(other than static methods). but this is not
the case y?

Is This Answer Correct ?    1 Yes 0 No

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

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

More Java Related AllOther Interview Questions

What is resultsetmetadata in java?

0 Answers  


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

0 Answers   Cap Gemini,


What is spliterator in java se 8?

0 Answers  


What are the types of cookies in java?

0 Answers  


When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?

0 Answers  


Explain working of java virtual machine (jvm)?

0 Answers  


Explain suspend() method under thread class>

0 Answers  


What is use of jpa?

0 Answers  


Which instutute is offering course for rhino jain slee

0 Answers  


How do you check if java is installed on windows command prompt?

0 Answers  


What is the singleton class in java?

3 Answers  


Why do we create dto in java?

0 Answers  


Categories