File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What exactly is a java source code file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What exactly is a java source code file?" Watch "What exactly is a java source code file?" New topic
Author

What exactly is a java source code file?

Divya Koshy
Greenhorn

Joined: Mar 14, 2014
Posts: 1
Hey,

I am preparing for ocjp 6 and I wanted to know what exactly a source code file is and why Java allows only one public class per source code file.

Thanks in advance
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3646
    
  15
Divya Koshy wrote:what exactly a source code file is
Surprisingly enough, a Java source code file is a file that contains Java source code.
Once you have written your Java source code, you use the compiler to compile the source file into one or more class files.

Divya Koshy wrote:why Java allows only one public class per source code file.
That question has been asked and answered many times on these forums - use the search.


Joanne
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What exactly is a java source code file?