This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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