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 happens when a main method is declared as private?

Answer Posted / pawan

vani, varsha is correct , the 'private main method' is as
good as any member method your class can have (note that
main is not a key word in java) , it can be only used inside
the class in which it is defined.

It is clearly mentioned in the specifications that the
executing class should contain a 'public static void method'
as a point of execution otherwise execution will fail
complaining ABOUT THE METHOD WHICH I MENTIONED ABOVE.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between overriding & overloading?

1073


Can you give few examples of final classes defined in java api?

1006


What is meant by class and object in java?

1047


What is the purpose of static methods and static variables?

1073


What about static nested classes in java?

1151


How can you traverse a linked list in java?

1129


What is passing by reference in java?

1028


How a string is stored in memory?

1025


Is overriding possible in java?

965


What is supplier in java?

1005


When is the arraystoreexception thrown?

1027


Which class should you use to obtain design information about an object in java programming?

1080


What is data and its types?

1005


What is literal example?

953


What are the different tags provided in jstl?

956