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.
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.