IS it Compulsory that a class name is same as file name in java?
Answer Posted / ajay gunjal
It is only recommended to use class name as a file name but it is not compulsory.
but if you have two or more classes with one is public and in that you write main() function then compiler create all class file but for searching of the entry point it is difficult and very tedious job.
so that's why if the class is public then use class name as a file name.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers