Classe 类型的层次结构不一致 [英] The hierarchy of the type Classe is inconsistent

查看:44
本文介绍了Classe 类型的层次结构不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个实现抽象类的类.抽象类在我项目的另一个包中.通过配置构建路径/项目添加了类抽象的包.在实现的类中指责以下错误:类型类的层次结构不一致

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 构建路径(如果您使用的是 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆