简体   繁体   English

在同一个包中导入类

[英]Importing class in the same package

I went through some of topics, but didn't find a proper anser.我浏览了一些主题,但没有找到合适的 anser。 I'm trying to import class to other class, but I get "The import "classname" cannot be resolved" error.我正在尝试将类导入其他类,但出现“无法解析导入“类名””错误。 Both classes are in the same package.两个类都在同一个包中。 What can cause the problem?什么会导致问题? I also tried to clean my project.我也尝试清理我的项目。

如果两个类都在同一个包中,则不必导入它。

不,因为我们在这里使用继承概念。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM