+ 3
Can there be multiple classes in Java
like c++ can have as many classes as you want... is it same with Java?
4 odpowiedzi
+ 3
Yes, you can have multiple classes
However, there can only be one public class per .java file.
As public classes must have the same name as the source file.
+ 4
Thank You.. For your help...
But another question so what will happen if we rename the source file?.. Sorry I am just learning java and don't have much knowledge about it so it maybe a silly question...
+ 2
sorry Omkar Gurav
I dont know the answer to your second question.
+ 2
You will get a compilation error if you try to compile after renaming the file