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

Can an anonymous class be declared as implementing an interface and extending a class in java programming?

1361


What is the method in java?

1137


What is map in java?

1048


what invokes a threads run() method? : Java thread

1059


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread

1091


Why there are some null interface in java? What does it mean?

1184


Define max and min heap, also the search time of heap.

1075


Name few "optional" classes introduced with java 8 ?

1185


Does constructor be static?

1085


What is the syntax and characteristics of a lambda expression? Explain

1091


If you are given the name of the function at run time how will you invoke the function?

1187


What is the difference between member variables initialization and assignment in a constructor?

1334


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

1070


Is java still relevant?

1025


Why does java not support pointers?

1172