Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sushant Sahoo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic