title: Create a class instance
body: <p>I am just starting to use Java. I am using NetBeans and inside my .pkg1 file I have two .java files. I am doing the Coursera course on Algorithms by the way, so my code references that:</p>
  
  <p>CourseraAlgorithmsWeek1.java</p>
  
  <pre><code>package coursera.algorithms.week.pkg1;
  
  public class CourseraAlgorithmsWeek1 {
      public static void main(String[] args) {
          QuickFindUF mystuff(10); // DOES NOT WORK!
      }  
  }
  </code></pre>
  
  <p>QuickFindUF.java</p>
  
  <pre><code>public class QuickFindUF {
      private int[] id;
  
      public QuickFindUF(int N){
          id = new int[N];
          for(int i =0; i&lt; N; i++){
              id[i] = i;
          }
      }
  }
  </code></pre>
  
  <p>My problem is that the first line in my main function does not recognize the QuickFindUF object creation. I read that I need to compile the second file into a .class file, and then into a .jar file. How can I do this with netbeans?</p>
  
  <p>I also read a bit about the Classpath. Can I only add .jar files to the classpath?</p>