how to create a "package" in Java?
<p>I have two classes, Parent and Child. The code for the classes are like this:  </p>

<p><strong>Parent.class</strong></p>

<pre><code>package test;
import java.util.*;

public class Parent {
    public static void main(String[] args) {
        Child child = new Child();
    }
}
</code></pre>

<p><strong>Child.class</strong></p>

<pre><code>package test;
import java.util.*;

public class Child {
    public Child() {
        System.out.println("A Child object has been created");
    }
}
</code></pre>

<p>I put both classes in a directory named "test". I can compile Child.java without any problem but I cant Compile Parent Class. It says that it cannot find the child class. What is the problem?</p>
