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
Is singleton class immutable?
Does A Class Inherit The Constructors Of Its Superclass?
what is object-oriented programming in java?
When is the finalize() called?
Is java call by value?
What is string substring?
Is int primitive data type?
What is the purpose of stub and skeleton?
What is the public field modifier?
What is meant by javabeans?
What is a platform?
Are arrays classes in java?
Does java list allow null?
What is the locale class in java programming?
Give any two differences between C++ and java.