Originally posted by Claire Yang:
But if you compile this two program separately, the "Client1.java" won't compile
I think that the compiler needs to load the TopLevelClass.class in order to compile Client1.java, and it can't find it in the classpath.
Try to compile the source files from the directory that contains the package directory. e.g.
My current directory is the one that contains the test directory (test is the package that the classes are in):
javac test\TopLevelClass.java
javac test\Client1.java
This worked for me (I'm using
java 1.4.1). If that still doesn't work, you could try setting your classpath, or using javac -classpath