Question
Can we put more than one public class in single java file?
Answer
No, we cannot. Because, when we declare a class as public, then we have to save the java file with same name as the name of the public class.
Can we put more than one public class in single java file?
No, we cannot. Because, when we declare a class as public, then we have to save the java file with same name as the name of the public class.