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 / chinmay

If main method declared as private then at compilation no problem but at run time it shows an error that main method should be public...
because we access the main() method out side from class if it is private then it cannot be accessible...
that's why we have to write public in main method signature...

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a custom exception?

949


What is an example of a constant variable?

1007


What modifiers may be used with an inner class that is a member of an outer class in java programming?

1018


What is var keyword ?

1126


What is lazy initialization in java?

938


What is the significance of java packages?

1065


Why are arrays useful in java?

973


Can a constructor call the constructor of parent class?

974


What does indexof mean?

943


What is the difference between compile-time polymorphism and runtime polymorphism?

934


Can an interface have a class?

945


Why parameters should be passed by reference?

911


What is the purpose of return statement?

1011


Explain notifyall() method of object class ?

1044


How do you define a method?

923