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


Please Help Members By Posting Answers For Below Questions

What is a vararg?

535


What do you mean by constant time complexity?

590


What are the differences between string, stringbuffer and stringbuilder?

509


Why are getters and setters used?

560


What is java in layman terms?

515






What is local declaration?

479


Can you extend singleton class?

594


What is a static class in java?

547


What does this () mean in constructor chaining concept?

548


What is mvc in java?

547


What are data types in oop?

536


What is package protected in java?

515


Can you declare an interface method static?

574


Can You Have Virtual Functions In Java?

577


What is the indent key?

581