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 is string buffer?
What is an immutable object?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
What is a Hash Table? What are the advantages of using a hash table?
Why you should not use singleton?
Can you make a constructor final in Java?
When do you call copy constructor?
What does || || mean in math?
Why is java logo a cup of coffee?
What are 4 pillers of object orinted programming?
Can we have 2 main methods in java class?
What are the advantages of exception handling?
What is the purpose of finalization in java programming?
What is integer size in java?
Why do I need to declare the type of a variable in java?