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

Posted on    July-14-2015 12:02 AM

 Java Java 
 1 Answer(s)
  492  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

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