문제

I have a class that extends the LinkedList class. Here's an excerpt of the code:

class SortedList<Integer> extends LinkedList<Integer> {
      int intMethod(Integer integerObject){
          return integerObject;
      }
}

This is expected to return the auto-unboxed int value. But for some reason, the compiler throws an error that says that the types are incompatible and that the required type was int and the type found was Integer. This works in a different class perfectly fine! What gives? :(

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top