划掉导入的java包 [英] Crossed out imported java packages

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

问题描述

在我的java程序中,我在一个类中导入了一些java包.但其中有 1 或 2 个包裹被划掉了.

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?

推荐答案

那些类被标记为 @Deprecated.

Those classes are marked as @Deprecated.

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

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

带有@Deprecated 注释的程序元素是程序员的不鼓励使用,通常是因为它很危险,或者因为存在更好的选择.编译器在不推荐使用的程序时发出警告元素在未弃用的代码中被使用或覆盖.

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.

检查已弃用类的 javadoc 以检查要改用哪些类.

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

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

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