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 do you mean by aggregation?

1187


What is the purpose of default constructor?

956


Is main is a keyword?

946


How does varargs work in java?

1036


What are the different approaches to implement a function to generate a random number?

997


What are namespaces in java?

975


Can you achieve runtime polymorphism by data members?

1074


what is the difference between Object Based Language and Object Oriented Language?

972


Why does java does not support multiple inheritance? Explain

923


What is polymorphism java example?

937


what r advatages of websphere? & how to deploy?

2103


Which java version is latest?

962


What do you understand by an io stream?

982


What is the purpose class.forname method?

915


How to perform linear search in java?

898