• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What exactly is a java source code file?

 
Divya Koshy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic