다음과 같이 중첩 된 일반 매개 변수를 사용하여 MinMaxPriorityQueue
를 만드는 방법 :중첩 된 일반 매개 변수로 MinMaxPriorityQueue를 만드는 방법은 무엇입니까?
MinMaxPriorityQueue<AtomicCountHolder<E>> sortedHeap;
정적 create()
메서드로 생각할 수있는 모든 종류의 변형을 시도하고 빌더를 사용하지 마십시오. 그것은
MinMaxPriorityQueue<Integer> s = MinMaxPriorityQueue. <Integer>create();
함께 작동하지만 중첩 제네릭 아닙니다. 모든 단서가 도움이 될 것입니다.
AtomicCountHolder은 AtomicInteger를 확장합니다. 그래서 Comparable을 구현해야합니다. –
@Hein :'AtomicInteger'는'Comparable'이 아닙니다. – ColinD