WHAT IF THE MAIN() METHOD IS DECLARED AS PRIVATE?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
Java 
 886  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What if the main() method is declared as private?

    The program compiles properly but at runtime it will give "main() method not public." message.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!