title: Accessing other class files in Java
body: <p>We've just started learning Java for my degree and I've been given a folder with various Java classes in, each in their own .java file, with the file name the same as the name of the class it has it in. </p>
  
  <p>There is one file which hosts a public class which has the following in:</p>
  
  <pre><code>public static void main(String[] args) {}
  </code></pre>
  
  <p>This creates a new instance of another class which is stored in a separate .java file, and many of the classes (each in their own .java file) seem to reference other classes without having to put anything such as</p>
  
  <pre><code>include("otherclass.php")
  </code></pre>
  
  <p>If you were working in PHP.</p>
  
  <p>My question is: Is this how Java does things? So you can happily refer to other classes and create new instances of a class from another .java file as long as they are in the same directory?</p>
  
  <p>I hope my question makes some sense!</p>
  
  <p>Thanks,</p>
  
  <p>Jack.</p>