Can a Java file have no 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 .

Sizin İçin Seçtik  What is terminal in java?

Leave a Reply

Your email address will not be published. Required fields are marked *