Explain class A{}
class B{}
class C{}
all the three classes are saved in a single file name, what
the name should i provide to the file ,in what file name
should i run the program? Ple Explain
Answer Posted / sarabjit singh
when a code is to wriiten in a single file, no matter how
many number of classes being used, the de-facto standard
for naming the file is <ClassName>.java,
where <ClassName> is the name of the class containing the
main function().
Hence in our case, if class A is having the main() method,
then the file name would be A.java.
| Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
What is multithreading in java?
What is the inheritance?
How does compareto work in java?
What is the purpose of using break in each case of switch statement?
How many bits is a string?
what is object-oriented programming in java?
In which language java is written?
What is get () in java?
What is an immutable class? How to create an immutable class?
What is output buffer?
Does constructor creates the object ?
What are the two basic ways in which classes that can be run as threads may be defined?
What are the types of java languages?
Why put method is idempotent?
Why do we create public static method in java?