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
Why is singleton instance static?
Is 0 an even number?
What is r in java?
In which order the iterator iterates over collection?
What are kinds of processors?
What is difference between Heap and Stack Memory?
What is a subsequence of a string?
Can you override static methods?
Can we restart a dead thread in java?
How do you get length in java?
What is void data type?
What is the difference between compare and compareto in java?
What is the significance of java packages?
How can we find the sum of two linked lists using stack in java?
Why do people says “java is robust”?