编译Java类时出现以下错误:BlueJ。Java未经检查或不安全操作消息
try {
ObjectInputStream in = new ObjectInputStream(new FileInputStream(Filename));
ArrayList<AuctionItem> AuctionList = (ArrayList<AuctionItem>) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
我可以请有一些信息,为什么被显示此错误,并且一些帮助:
AuctionManager.java uses unchecked or unsafe operations.
当下面的反序列化的代码是在我的一个功能时,才会显示此错误使用没有错误的反序列化代码。
什么是修复代码的最佳方法,以便警告不显示? – user2351151 2013-05-13 04:55:59