Course Content
Core Java
About Lesson
  1. Java source file is a text file that contains Java code, typically with a .java file extension. • It serves as the input to the Java compiler (javac), which translates the source code into bytecode.
  2. Only one public class is allowed in one source file. Name of source file should be same as name of public class if public class is present.
  3. Source file can have any number of non-public classes. Non-public classes does not have any impact on naming of source file.
  4. If the source file consists of only non-public classes, then the file could have any name.

Scroll to Top