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
define polymorphism in java
What is java abstraction with example?
What is the difference between break and continue statements?
Java Compiler is stored in JDK, JRE or JVM?
Mention some features of java?
Explain the difference between collection api and stream api in java8?
How large is a boolean?
What is int lol?
Is string a data type in java?
How does queue work in java?
what is difference betweem home interface and remote interface?
When should you use arraylist and when should you use linkedlist?
Explain the concept of proper inheritance?
What happens if we override only equals?
What about features of local inner class?