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

List implementations of list interface?

569


How do you declare an array in java?

525


What is a treeset class?

569


How many unicode characters are there?

567


What is Hierarchy of exception?

655






What is number data type?

536


What's the purpose of using break in each case of switch statement?

518


What is palindrome in java?

564


What methods are used to get and set the text label displayed by a button object?

561


Why pointers are not used in java?

589


What is parse method?

553


Is string a class in java?

519


What is difference between ++ I and I ++ in java?

541


What happens if constructor is private?

573


Explain the difference between association, aggregation and inheritance relationships.

562