Tag: 未经检查

如何使用-Xlint进行编译:未选中?

编译我的代码时收到一条消息: Note: H:\Project2\MyGui2.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 我如何用-Xlint:unchecked重新编译-Xlint:unchecked ?

用Java创build空白地图的最佳方法

我需要创build一个空的地图。 if (fileParameters == null) fileParameters = (HashMap<String, String>) Collections.EMPTY_MAP; 问题是上面的代码会产生这样的警告: types安全性:取消选中从映射到HashMap 什么是最好的方式来创build这个空的地图?

什么是Java中的SuppressWarnings(“unchecked”)?

有时通过代码查看,我看到许多方法指定一个注释: @SuppressWarnings("unchecked") 这是什么意思?