0
is it compulsory to have class name same as source file name????
I wrote a program with first as class name and save run as source file name but it runs successfully why???. it doesn't gives any error
6 Answers
+ 1
Yes. My program on eclipse didn't work when class and saved file name was different.
+ 1
If you define the class name as 'public', then the name of the file and the class will HAVE to be the same, else, no.
+ 1
thanks
0
no
- 1
not necessary. while compiling compile with the class name and while running the program run it with file name with which u saved the file
- 1
its not mandatory to have class name and file name same.