title: Importing packages in Java
body: <p>How to import a method from a package into another program? I don't know how to import... I write a lil' code: </p>
  
  <pre><code>package Dan;
  public class Vik
  {
      public void disp()
      {
          System.out.println("Heyya!");
      }
  }
  </code></pre>
  
  <p>and then, saved it in a folder named "Dan" and I compiled it. The .class file is generated. Then, I wrote this code below:</p>
  
  <pre><code>import Dan.Vik.disp;
  class Kab
  {
      public static void main(String args[])
      {
          Vik Sam = new Vik();
          Sam.disp();
      }
  }
  </code></pre>
  
  <p>and I saved it outside the folder "Dan" and it says : "cannot find symbol"</p>
  
  <p>I saved the first code in C:\Dan\Vik.java
  and the second in C:\Kab.java</p>