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

Why do we use public static with the main function in Java?

Answer Posted / rana

As we know public means we can access the method from
anywhere.Coming to static:- main() is a static method
therefore it implies that there is no need of creating
Object for that particular class to call this method.So
that when ever u run the program the Jvm will search for
main() in the class even there r no class objects created
for this class.

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java thread dump, how can we get java thread dump of a program?

990


Is alive and join method in java?

1154


Can inner class be public in java?

1008


Differences between C and Java?

1183


Can we declare register variable as global?

924


How do you input a string in java?

1056


How do you download stubs from Remote place?

1775


Can we extend singleton class?

943


Is string serializable in java?

1009


Is singleton set an interval?

956


What is the difference between iterator and enumeration ?

1001


What is field name?

1010


What is increment in java?

956


What is difference between static class and normal class?

1104


What are the methods used to implement for the key object in the hash map?

1031