실행 실패 (제출 코드 컴파일 에러)
Main.java:7: error: incompatible types: cannot infer type arguments for HashMap<> static HashMap<Integer, List<Wood>>[] woods = new HashMap<>(); ^ reason: no instance(s) of type variable(s) K,V exist so that HashMap<K,V> conforms to HashMap<Integer,List<Wood>>[] where K,V are type-variables: K extends Object declared in class HashMap V extends Object declared in class HashMap Main.java:23: error: cannot find symbol List<Wood> list = woods.getOrDefault(y, new ArrayList<>()); ^ symbol: method getOrDefault(int,ArrayList<Object>) location: variable woods of type HashMap<Integer,List<Wood>>[] Main.java:25: error: cannot find symbol woods.put(y, list); ^ symbol: method put(int,List<Wood>) location: variable woods of type HashMap<Integer,List<Wood>>[] Main.java:28: error: cannot find symbol List<Integer> yList = new ArrayList<>(woods.keySet()); ^ symbol: method keySet() location: variable woods of type HashMap<Integer,List<Wood>>[] Main.java:32: error: cannot find symbol List<Wood> list1 = woods.get(yList.get(i)); ^ symbol: method get(Integer) location: variable woods of type HashMap<Integer,List<Wood>>[] Main.java:34: error: cannot find symbol List<Wood> list2 = woods.get(yList.get(j)); ^ symbol: method get(Integer) location: variable woods of type HashMap<Integer,List<Wood>>[] 6 errors
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
비공개 코드입니다. 코드 작성자만 볼 수 있습니다.
반례를 발견하지 못했습니다.