我有以下代码:什么是未检查和不安全的操作?
private static final Set<String> allowedParameters;
static {
Set<String> tmpSet = new HashSet();
tmpSet.add("aaa");
allowedParameters = Collections.unmodifiableSet(tmpSet);
}
而且这会导致:
Note: mygame/Game.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
当我建议的选项重新编译我看到一个指针(^)在“新”指向的HashSet();
前。
有人知道这里发生了什么吗?