How are Java source code files named?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is backdrop?
How thread scheduler schedule the task?
What's the base class of all exception classes?
What is the difference between state-based unit testing and interaction-based unit testing?
Explain the reason behind ending a program with a system.exit(0)?
What do you understand by a Static Variable?
what is purpose of collections.unmodified() method..?
What is the purpose of using javap?
Implement two stacks using a single array.
what are the boundaries of jdk and jre?
What are the new features in java 8? Explain
Why char array is preferred over string for storing password?