x***n 发帖数: 291 | 1 no need to import as long as ur files are under the same dir, and
you can just do it. if you want to use import, you need specify the
dir name where your file reside.
suppose you put file1.java in dir /java/file/file1.java
your file1.java should indicate the package name, like :
//file1.java code
package file;
public class file1 .....
and you put use.java in dir /java/use.java
//use.java code
import file.*;
public class use ...
Now you can use file1.java in use.java.
you can compile both files u |
|