aspose file tools*
The moose likes Beginning Java and the fly likes only 1 public class per source file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "only 1 public class per source file" Watch "only 1 public class per source file" New topic
Author

only 1 public class per source file

shivam aggarwal
Greenhorn

Joined: Oct 15, 2009
Posts: 8
we can have only 1 public class per source file and that source file must be named (name of public class.java).why?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10906
    
  12

because it makes implementing the JVM easier.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: only 1 public class per source file
 
Similar Threads
Abstract class
source file?
Why should there be only one public class per source file
Public class
Class using Main without declaring itself Public