How are Java source code files named?

Answers were Sorted based on User's Feedback



How are Java source code files named?..

Answer / niranjanravi

A java source code file contains atmost one public class
or interface defined with in the file.Java source code
files takes the name of the public class or interface that
is defined with in the source code file.If no public class
or interface is defined with in the source code file then
file must take on a name that is different than its public
class or interface.

Is This Answer Correct ?    2 Yes 0 No

How are Java source code files named?..

Answer / ravikiran(aptech mumbai)

java source code names will be named withthe name of the
class that is declare as publicwith .java extension

Is This Answer Correct ?    1 Yes 0 No

How are Java source code files named?..

Answer / vijayakumar chinnasamy

If a java source code file contain public class then the
source code file name should be public class name other
wise compiler error.


if a java source code does not contain the public class
then the name may be class name or anything ,not a problem.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Difference between overriding and overloading in java?

0 Answers  


Differences between C and Java?

0 Answers   TCS,


What is the reason behind using constructors and destructors?

0 Answers   HCL,


Differentiate between stringbuffer and stringbuilder in java.

0 Answers  


Explain the reason behind ending a program with a system.exit(0)?

0 Answers  


What are thread safe functions?

0 Answers  


What is the largest long allowed by java?

0 Answers  


Difference between method overloading and overriding.

0 Answers  


How to create a thread in java?

0 Answers  


Which variables are stored in heap?

0 Answers  


What is meant by inheritance and what are its advantages?

0 Answers  


In real time project which driver did u use? What is the main functionality of the Prepared Statement?

3 Answers   Photon,


Categories