交叉导入java包 [英] Crossed out imported java packages

查看:148
本文介绍了交叉导入java包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的java程序中,我已经在一个类中导入了一些java包。
,但在那里有1或2个包被划掉了。



为什么会发生这种情况?
如何解决这个十字架,使得不交叉?

解决方案

这些类被标记为 @Deprecated



这意味着编译器建议不要使用它们,因为它们可能会给您带来问题。


注释@Deprecated的程序元素是程序员不要使用
,通常是因为它是危险的,或者因为
a更好的选择存在。编译器在不推荐的程序
元素被使用或覆盖不被废弃的代码时发出警告。


检查javadoc的已弃用的类来检查要使用的类。


In my java program, I have imported some java packages in one class. but in there 1 or 2 packages were crossed out.

Why that happened? How to solve this cross out to make uncrossed?

解决方案

Those classes are marked as @Deprecated.

This means that the compiler advises not to use them, because they can bring you problems.

A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. Compilers warn when a deprecated program element is used or overridden in non-deprecated code.

Check the javadoc(s) of the deprecated classes to check which classes to use instead.

这篇关于交叉导入java包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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