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 is java lang exceptionininitializererror?

911


What is dto in java?

899


What is the use of flatmap in java 8?

854


Is java built on c?

979


How do I enable java in firefox?

1074


What is the use of entity class in java?

921


In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.

2123


What is the difference between Logical Parallelism and Physical Parallelism?

3390


Why is class forname used in java?

1049


Why is struts used in java?

867


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

936


Explain the inheritance principle.

920


What are the disadvantages of java sockets?

1093


Are the actual permissions for the application defined at run-time or compile-time? : java security

934


Where is java installed?

866