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


Please Help Members By Posting Answers For Below Questions

What is a boolean in java?

670


Is a method a procedure?

651


What is the format specifier?

604


Do we have pointers in java?

615


How do you square a number in java?

665






What is the difference between logical data independence and physical data independence?

650


Will the jvm load the package twice at runtime?

679


What language is an assembler written in?

647


What does it mean that strings are immutable?

695


In how many ways we can do exception handling in java?

672


What is the maximum length of a url?

621


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

601


What does math floor () do?

647


What is an example of a boolean?

670


What are the six ways to use this keyword?

715