覆盖已弃用的API。 [英] overrides a deprecated API.

查看:173
本文介绍了覆盖已弃用的API。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

import java.io. *;


class InputTest

{

public static void main(String [] args抛出IOException

{

byte [] bytes = new byte [20];

BufferedInputStream bis = new BufferedInputStream(System.in);

DataInputStream dis = new DataInputStream(bis);

String str = dis.readLine();


DataOutputStream dos = new DataOutputStream(System.out);

dos.writeUTF(str.toUpperCase());


dos.close();


System.out.println(程序结束); //这不会打印


}

}
这是我尝试编译此代码帮助时的结果我出去了...... !!! Java \ jdk1.5.0 \bin> javac InputTest.java


注意:InputTest。 java使用或覆盖不推荐使用的API。

注意:使用-Xlint重新编译:弃用以获取详细信息。

import java.io.*;

class InputTest
{
public static void main(String []args) throws IOException
{
byte [] bytes = new byte[20];
BufferedInputStream bis = new BufferedInputStream(System.in);
DataInputStream dis = new DataInputStream(bis);
String str = dis.readLine();

DataOutputStream dos = new DataOutputStream(System.out);
dos.writeUTF(str.toUpperCase());

dos.close();

System.out.println("End of program"); // this willnot be printed

}
}
This is the result when i try to complie this code help me out...!!!Java\jdk1.5.0\bin>javac InputTest.java


Note: InputTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

推荐答案

1.。请使用代码下次发布代码时的标签。

2.)你可以按照编译器的说法进行操作,并使用-Xlint进行重新编译检查并自己查看大惊小怪。

3 。)为什么不使用java.util.Scanner从控制台获取输入?
1.) Please use code tags next time when posting code.
2.) You could do as the compiler says and recompile with -Xlint checked and see for yourself what the fuss is about.
3.) Why don''t you use java.util.Scanner for getting input from the console?



1.)请使用代码下次发布代码时的标签。

2.)你可以按照编译器的说法进行操作,并使用-Xlint进行重新编译检查并自己查看大惊小怪。

3 。)为什么不使用java.util.Scanner来获取输入从控制台?
1.) Please use code tags next time when posting code.
2.) You could do as the compiler says and recompile with -Xlint checked and see for yourself what the fuss is about.
3.) Why don''t you use java.util.Scanner for getting input from the console?



谢谢你的回复我只是java.i''m这个社区的新手。我不知道帖子的语法。

thank you for your reply i''m just a beginer in java.i''m new to this community.i don''t know the syntax for postings.



1.)下次发布代码时请使用代码标签。

2.)你可以按照编译器的说法进行重新编译并使用-Xlint进行重新编译,然后自己查看大惊小怪。

3.)为什么不使用java.util.Scanner从控制台获取输入?
1.) Please use code tags next time when posting code.
2.) You could do as the compiler says and recompile with -Xlint checked and see for yourself what the fuss is about.
3.) Why don''t you use java.util.Scanner for getting input from the console?



这是什么(重新编译-Xlint:弃用以获取详细信息。)意味着如何使用-Xlint重新编译tat?

what does this(Recompile with -Xlint:deprecation for details.) mean how to recompile tat with -Xlint????


这篇关于覆盖已弃用的API。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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