我试图运行此代码:的Java:无法在地图上找到符号错误,HashMap的
import java.util.*;
public class NxtStart {
ScanReg sr = new ScanReg();
}
这一直给我下面的错误:这个类中
import java.util.*;
public class ScanReg {
public Map<Integer, ArrayList<Long>> scanMap = new HashMap<Integer, ArrayList<Long>>();
}
.\ScanReg.java:6: error: cannot find symbol
public Map<Integer, ArrayList<Long>> scanMap = new HashMap<Integer, Arra
yList<Long>>();
^
symbol: class Map
location: class ScanReg
.\ScanReg.java:6: error: cannot find symbol
public Map<Integer, ArrayList<Long>> scanMap = new HashMap<Integer, Arra
yList<Long>>();
^
symbol: class HashMap
location: class ScanReg
2 errors
有人可以告诉我为什么吗?
你没有自己的名为'java.util'的本地包吗?我会尝试导入整个类名:'import java.util.Map;',对于其他使用的util类(如HashMap)也是如此。 –
没有帮助: -/ –
Kal可能会对某事(1+对他!)。 –