This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes why more than one public class not allowed in a source file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why more than one public class not allowed in a source file?" Watch "why more than one public class not allowed in a source file?" New topic
Author

why more than one public class not allowed in a source file?

Sushant Sahoo
Greenhorn

Joined: Jan 15, 2009
Posts: 1
why in java more than one public classes are not allowed?
There should be some reason and I hope somebody will explain me.
Thanks in advance.

sushant
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

I asked Mr. Google Why only one public class in a Java file and he was able to point me a fine article that explains that doing such was a design decision to make the compiler more efficient.
 
Consider Paul's rocket mass heater.
 
subject: why more than one public class not allowed in a source file?