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

Answer Posted / malay

I think that you call only public classes from outside.Now
all these classe are kept in a .java file.So there should
be a one to one mapping between a public class
& .java/.class file.If there are more than one public
classes then JVM has to maintain a tracker that what all
classes are in single .java/.class file.Presently its easy
for JVM coz when a class is called it simply goes & load
the .class file with that name.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does split work in java?

528


Can a class extend 2 classes in java?

554


What is an immutable class?

612


How do you use parseint in java?

509


What is a dynamic array java?

514






What is private public protected in java?

568


What is the difference between inner class and nested class?

548


What is java lang object?

527


What is multithreading and its advantages?

571


What is finalize method?

573


What is t type java?

622


How do you sort arraylist in descending order?

570


Print Vertical traversal of a Binary Tree.

603


What are different types of encoding?

578


Tell us something about set interface.

559