Home > DeveloperSection > Interviews > Is it possible to have multiple public classes in Java ?

Posted on    July-14-2015 12:02 AM

 Java Java 
Ratings:
 1 Answer(s)
  357  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-14-2015 12:02 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick