Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

what is diffrence between .NET and java?

2 Answers  


System.out.println("somestring"); It will create any object or not

5 Answers   CSC,


How can I debug the Java security exceptions and AccessControlExceptions?

0 Answers   IBM,


Why should we use singleton pattern instead of static class?

0 Answers  


Is hashset sorted in java?

0 Answers  






What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

0 Answers  


List some features of the abstract class.

0 Answers  


Can we have two main methods in a java class?

0 Answers  


what is the difference between the "protected and default" modifiers?

8 Answers  


Which collection does not allow duplicates in java?

0 Answers  


Is math class static in java?

0 Answers  


What is difference between stringbuffer and string?

0 Answers  






Categories