Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

only one PUBLIC CLASS per source file..... But Why..?????

807606Apr 23 2007 — edited Apr 23 2007
Lets say i have ten java classes and i want all of them to be public. It implies(according to java) that i need to declare each of them in a different source file. But that is so irritating. Why is it so strictly compulsory..?? Will it be a problem if i have al my public classes in the same source file..?? According to java syntax, YES it is a problem... but what is the logical problem....??? ( Is it that just because the java guys wanted the file name to be the same as that of the public class they decided to have just one public class per source file.. I dont think thats the reason...)

Sorry for the lengthy question...

Some one please help....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2007
Added on Apr 23 2007
28 comments
1,451 views