title: Java Packages - refer to a class from a different package
body: <p>In the (default package) I have a class called "Bird" that has a method called "dialog".</p>
  
  <p>I can create a class called Class1 within the same package, like this:</p>
  
  <pre><code>public class Class1
  {
      public static void main(String[] args) 
      {
          Bird b = new Bird("Alexander",true,5);
          b.dialog("tweet!");
      }
  }
  </code></pre>
  
  <p>This actually works and I actually get to see <code>tweet!</code> in the console.</p>
  
  <p>My question is: what do I need to add in the code if <code>Class1</code> is located in the package <code>Fundamental</code>  (whereas the class <code>Bird</code> is located in the "default package")?
  I get an error: "Bird type not recognised" in this case. I should probably indicate the package somehow. </p>
  
  <p>Side questions: 1. What is a classpath and how do you change it? I have seen this term vaguely used in the context of several package-related discussions, but none with clear examples as I just gave. 
  2. I have seen many times packages called xxx.bla.zzz - is this a standard? I only usually use a common name (not three separated by .)
  I understand a package is Java's replacement for namespaces in other languages. If there are several solutions solutions worth mentioning, I'd appreciate. Thank you!</p>