请教,怎么去掉编译中出现的关于某个方法"has been deprecated"的警告?

kobee 2003-10-20 05:20:44
如题
...全文
4794 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kobee 2003-10-20
  • 打赏
  • 举报
回复
12,12,12,12,2
结贴人不允许自己给自己分!!

靠!
kobee 2003-10-20
  • 打赏
  • 举报
回复
java.io.DataInputStream.readLine()
This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form:
DataInputStream d = new DataInputStream(in);

with:
BufferedReader d
= new BufferedReader(new InputStreamReader(in));

解决了,谢!
exitzhang 2003-10-20
  • 打赏
  • 举报
回复
把javadoc注释中的@deprecated去掉
希偌 2003-10-20
  • 打赏
  • 举报
回复
那是不提倡使用的方法(在老的jdk版本中使用,但为了兼容性没有被删除,这种方法在新的jdk版本中一定有相应的代替方法),可以加参数-deprecation进行编译
loveyousomuch 2003-10-20
  • 打赏
  • 举报
回复
同意,这说明该方法不建议使用,
但使用了也不会出错,
vampire1129 2003-10-20
  • 打赏
  • 举报
回复
说明该方法在API中有替代方法
JAVA不支持你定义的方法

62,617

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧