can two class in a code be public??if yes then how??

Answer Posted / siva

NO only one class should be public if we write multiple
classes in a same file.we can write multiple class files in
a single file.if main() is there in one of the classes then
it should be declare as public.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a numeric string?

559


When will you define a method as static?

549


Is java a utf 8 string?

524


Define inheritance with reference to java.

579


What is a default method?

515






What is difference between java and java ee?

552


What is the difference between keyword and identifier?

526


What is a type parameter in java?

526


Is it possible to instantiate the abstract class?

534


Why do we use string?

571


What is the exact difference in between Unicast and Multicast object? Where will it be used?

580


What is the maximum size of hashmap in java?

528


What are the files generated after using IDL to java compiler?

582


What is object data type?

560


What is passed by reference and pass by value ?

580