我装的是jdk1.50结果今天编译的时候出了一个这样的错误让我很不明白,有没有高手给解释一下为什么Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:deprecation for details.
如果使用了不推荐使用的方法,编译时产生的信息应该是: Note: Test.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 楼主遇到的问题很可能是因为没有按照5.0里的新的Generics语法来使用集合类,比如Vector、ArrayList 新的语法是类似这样的 List<String> list = new ArrayList<String>(); list.add("test"); String s = list.get(0);为了兼容以前的程序,旧的语法还可以继续使用,不过在编译的时候会输出楼主遇到的那种警告信息。 Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:deprecation for details.
对了,下载一个jdk 5.0 update 3吧,出错信息再也不是英文,而是中文了
javac file.java -Xlint:deprecation
不然怎么知道原因
是不是用了frame.show();
改成frame.setVisible(true);
frame是一个JComponent
Note: Test.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
楼主遇到的问题很可能是因为没有按照5.0里的新的Generics语法来使用集合类,比如Vector、ArrayList
新的语法是类似这样的
List<String> list = new ArrayList<String>();
list.add("test");
String s = list.get(0);为了兼容以前的程序,旧的语法还可以继续使用,不过在编译的时候会输出楼主遇到的那种警告信息。
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:deprecation for details.