可能重复: 如何访问默认包中的 java 类?
我正在使用 Eclipse 3.5,并且我已经创建了一个包结构和默认包一起的项目。我在默认包中有一个类 -计算,java,我想在任何包中使用这个类(例如在 com.company.calc
中)。当我尝试使用默认包中的类时,它会给我一个编译器错误。它无法识别默认包中的类。问题出在哪里?
Java-源代码
public class Calculations {
native public int Calculate(int contextId);
native public double GetProgress(int contextId);
static {
System.loadLibrary("Calc");
}
}
我不能把我的课放在任何其他的包里。这个类有一些在德尔斐实现的本机方法。如果我把该类放在任何文件夹中,我将不得不对该 DLL 进行更改,这是我想要避免的(真的-我不能)。这就是为什么我把我的类放在默认包中。