IS IT POSSIBLE TO HAVE MULTIPLE PUBLIC CLASSES IN JAVA ?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 534  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    Is it possible to have multiple public classes in Java ?

    As per java language specification, there can be only one public class in a file (.java) and file name should be same as public class name. If you want another class accessible in other places, you may create a separate java file.

Answer

NEWSLETTER

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