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
What is output buffer?
Is age discrete or continuous?
What will be the initial value of an object reference which is defined as an instance variable?
What is the difference between a constructor and a method?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What are the types of casting?
What are locale settings?
What kind of variables a class can consist of?
Explain about static nested classes in java?
What is autoboxing and unboxing?
What is a line separator in java?
What is an infinite loop? How infinite loop is declared?
How does queue work in java?
Explain serialization and deserialization in java?
What does .equals do in java?