Why only one Class is public in one file? Explain in
details. Thanks in Advance.

Answer Posted / mahendra

In an aplication public class is main class with main()
method as entry point

java compiler allows only one public class in file

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a java string?

547


What is method overloading in JAVA? Why is it not present in C ?

594


What are the advantages of passing this into a method instead of the current class object itself?

1177


How do you reverse sort in java?

508


What are the major advantages of internal iteration over external iteration?

581






how to handle exceptions in ejb?

1881


Is simpledateformat safe to use in the multithreaded program?

544


What should I import for arraylist in java?

512


What do you understand by the term singleton?

584


Can a class have multiple superclasses?

572


What is method in java with example?

494


What is the use of parse function in java?

518


what is a thread pool in java and why is it used?

534


What is array pointers ?

607


Can a private method be declared as static?

583