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...

In Java why we write public static void main(String args[])
why not main()?

Answer Posted / pandurang d billavar

for execution of class in java is done by creating a object
for methods of that class.so main method is also a class
method.so this method is called by jvm directly without
creating object for main method.it is possible only if main
is static.............so we maked main as static.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a finally block? Is there a case when finally will not execute?

1079


What is main in java?

1152


What is the hashcode () and equals () used for?

1038


What steps are taken when the OS shifts from one-thread execution to another?

1367


What is the difference between Grid and Gridbaglayout?

1246


What is return data type?

1008


What is type safety in java?

952


Can you extend singleton class?

1104


Define a package.

1085


Can a static class have a constructor?

1004


What restrictions are placed on method overriding?

1187


Are primitives objects?

1059


Define an abstract class with reference to java.

997


What are the application of stack?

923


What is difference between == and === in js?

1012