What happens when a main method is declared as private?
Answer Posted / amit kumar chaubey
If the main function is made private...it will compile
Sucessfully...and at the time of execution...it will
execute successfully...but desired result will not be
obtained. After execution..folowin message will be printed:
Main method not public.
Is This Answer Correct ? | 25 Yes | 3 No |
Post New Answer View All Answers
What is a vararg?
What do you mean by constant time complexity?
What are the differences between string, stringbuffer and stringbuilder?
Why are getters and setters used?
What is java in layman terms?
What is local declaration?
Can you extend singleton class?
What is a static class in java?
What does this () mean in constructor chaining concept?
What is mvc in java?
What are data types in oop?
What is package protected in java?
Can you declare an interface method static?
Can You Have Virtual Functions In Java?
What is the indent key?