Why to give the file name same as the public class name in
java?
Answer Posted / mahesh
First of all, it only has to be the same when the class is
public. And there is no explicit reason for that, it's just
a convention that came along with old versions of java and
people got used to it... They say it's because of the
limited capabilities of the compiler to compile
dependencies.
| Is This Answer Correct ? | 9 Yes | 4 No |
Post New Answer View All Answers
Is java an ide?
Why is java so important?
Which package has light weight components in java programming?
Is 9 a prime number?
How is string immutable in java?
What does indexof return in java?
Explain about procedural programming language or structured programming language and its features?
Which is faster string or stringbuilder?
What is the difference between heap and stack memory?
How to do encapsulation in java?
Which class is the superclass for every class in java programming?
What is OOP's Terms with explanation?
What is downcasting?
What is classpath?
Can we define a package statement after the import statement in java?