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


Please Help Members By Posting Answers For Below Questions

Difference between method overloading and method overriding in java ?

586


Define jre i.e. Java runtime environment?

587


What is a stringbuilder?

524


How strings are created in java?

578


How do you input a string in java?

518






What is linkedlist in java?

516


What are measurable parameters?

585


Do I need java for windows 10?

561


What is qualitative variable?

532


What are checked exceptions?

589


What is the difference between multiple processes and multiple threads?

581


how to create daemon thread in java?

625


How does java pattern compile work?

556


Explain abstract class in java?

565


How does enum work in java?

560