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 are constants?

1008


What is close method? How it's different from Finalize & Dispose?

1013


What is bean? Where it can be used?

1042


Can we have any code between try and finally blocks?

983


How much ram can a 64 bit processor theoretically?

841


Is java hashset ordered?

1067


How many ways can we create singleton class?

926


What is difference between word and integer?

1029


What is ascii code?

1177


What do you mean by data type?

982


What is compareto?

980


Can inner class be public in java?

990


What is the difference between array list and vector in java?

912


How do you trim a space in java?

937


How can we use primitive data types as objects?

915