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

How do I install java on windows?

852


What is an actionevent in java?

899


Can we write lambda without functional interface?

840


How can I write a program that takes command line input?

824


Is java singleton thread safe?

826


Is eclipse a jdk?

848


What is ui framework in java?

837


Do I need both jdk and jre?

944


What is the difference between java se and java ee?

801


Can a method be static and synchronized?

990


What is custom tag in java?

855


What is hql in java?

821


Why bean class is used in java?

857


What is the difference between swing and awt components?

1065


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

878