The actual requirement is slightly different: every Java public class must be in a compilation unit with the name PublicClassName. java . But it’s perfectly fine to have a compilation unit that does not contain a public class .
The actual requirement is slightly different: every Java public class must be in a compilation unit with the name PublicClassName. java . But it’s perfectly fine to have a compilation unit that does not contain a public class .