What happens when a main method is declared as private?
Answer Posted / dharma
main method signature must be like
public static void main(String args[])
if we declare as private then it compiles successfully
but at Runtime it says
"Main method not found in class"
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are bind parameters?
How do you sort a list in java?
What is incompatible types in java?
Can we sort set in java?
Explain the use of sublass in a java program?
What is java literals?
What is the difference between a factory and abstract factory pattern?
What are voids?
What is java in simple terms?
Is a case study a method or methodology?
What is static block?
What is the importance of static variable?
Why runnable interface is used in java?
why we use merge option in hybernate pls give a ex snippet
What is the return type of the main method?