How many public class can we have in Java?

A Java file contains only one public class with a particular name . If you create another class with same name it will be a duplicate class. Still if you try to create such class then the compiler will generate a compile time error.

Sizin İçin Seçtik  What are the 4 access modifiers in Java?

Leave a Reply

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