I have two classes, Parent and Child. The code for the classes are like this:
Parent.class
package test;
import java.util.*;
public class Parent {
public static void main(String[] args) {
Child child = new Child();
}
}
Child.class
package test;
import java.util.*;
public class Child {
public Child() {
System.out.println("A Child object has been created");
}
}
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?