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
Explain inheritance in java?
Can we make main() thread as daemon?
What are heap memory and stack memory and what are memory tables.
Explain about static imports in java?
What do you understand by the term singleton?
Differentiate between static and non-static methods in java.
Can a class be a super class and a sub-class at the same time? Give example.
What is method overloading with type promotion?
What does compareto () do in java?
What is toarray method in java?
What is the parse method in java?
What is jdbc api?
What is a boolean output?
What is string builder?
Explain the difference between private, public, package and protected in java?