title: Importing my classes from folder in Java
body: <p>So I have these classes,</p>
  
  <p>Exception1.java, Exception2.java, LinkedList.java, Iterator.java</p>
  
  <p>LinkedList needs Iterator, Iterator needs exceptions and exceptions are independent.</p>
  
  <p>So I put them in folder like this - </p>
  
  <pre><code>                     MyProject
         __________________|____________________
        /                  |                    \
  LinkedList.java     MyIterator.java      MyExceptions
                                      ___________|__________
                                     /                      \
                              Exception1.java         Exception2.java
  </code></pre>
  
  <p>Now how should I name the packages and import them in between them, such that, I can make a test.java outside of MyProject and use LinkedList class?</p>
  
  <p>Answer :</p>
  
  <p>I linked them like this.</p>
  
  <pre><code>LinkedList : package MyProject; import MyProject.MyExceptions.*;
  MyIterator : package MyProject; import MyProject.MyExceptions.*;
  Exception1 : package MyProject.MyExceptions;
  Exception2 : package MyProject.MyExceptions;
  test : import MyProject.*; import MyProject.MyExceptions.*;
  </code></pre>