This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why more than one public class not allowed in a source file?
 
Similar Threads
Static Block
Two classes defined in the same source file ??
Extending interface
Java 1.5 test Exercise 5-4 Sun Certified Programmer for Java 5
corrections in marcus green test1