자식 클래스의 메서드를 덮어 쓸 때 제네릭이 작동하는 방식을 잘 모르겠습니다.Java generics의 상속 된 메서드
import com.fasterxml.sort.DataReader;
public class CSVReader<E> extends DataReader<E>
{
private final ICsvListReader reader;
public CSVReader(InputStream in) {
reader = new CsvListReader(new InputStreamReader(in), CsvPreference.STANDARD_PREFERENCE);
}
@Override
public E readNext() throws IOException {
java.util.List<String> line=reader.read();
return line;//compilation error
}
}
오류
Type mismatch: cannot convert from List<String> to E CSVReader.java
나는이 문제를 어떻게 해결합니까? genericized 클래스를 확장 할 때 일반적으로