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
Is there any difference between synchronized methods and synchronized statements?
What are the limitations of procedural programming approach?
Why generics are used in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is the purpose of the System class?
How many types of classes are there in java?
What is == and === in javascript?
What is use of inner class in java?
What is the use of math abs in java?
What do you mean by object?
How to perform linear search in java?
What is singleton service?
What is the list interface in java programming?
Is there is any difference between a scrollbar and a scrollpane?
What is the difference between method overriding and overloading?