WHAT IF THE MAIN METHOD IS DECLARED AS PRIVATE?

Sumit Kesarwani

Total Post:782

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

    Post:782

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

    When a method is declared as private, the program compiles properly but it will give runtime error Main method not public

Answer

NEWSLETTER

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