类型Classe的层次结构不一致 [英] The hierarchy of the type Classe is inconsistent
问题描述
我有一个实现抽象类的类。抽象类在我项目的另一个包中。添加了通过Configure build path / Project将类抽象化的包。在实现的类中,发生以下错误:类型类的层次结构不一致
I have a class that implements an abstract class. The abstract class is in another package of my project. Added the package where the class is abstract by Configure build path/Project. In class that implements is accusing the following error: The hierarchy of the type class is inconsistent
我是否要将此软件包添加到其他位置?
Have I to add this package somewhere else?
谢谢!
推荐答案
发生这些错误是因为无法解决层次结构中的某些接口/类。
例如:错误在您的类中-类X,X继承Y,然后Y继承Z。但是,编译器无法解析z(在上面的错误中),因为z属于一个库,不包括在内。
因此,必须将包含z的软件包添加到类路径/或项目的Java Build Path(如果使用eclipse)。
希望它会有所帮助。
These errors happened because some interface/class in the hierarchy cannot be resolved. For example: the error is in your class - class X, X inherits Y, and in turn, Y inherits Z. However, the compiler cannot resolve z (in above error), because z is belong to a library that is not included. Therefore, you have to add package containing z to the classpath/ or project's Java Build Path (if you are using eclipse). hope it may help.
这篇关于类型Classe的层次结构不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!