i was having working code with earlier version of java 8 which i was using to get unique values from list but since i upgraded to JDK 66 its giving me an error
Type mismatch: cannot convert from List<Object> to List<String>
List<String> instList = new ArrayList<String>();
while (res.next()) {
instList.add(res.getString("INST").toString());
}
List<String> instListF = instList.stream().distinct().collect(Collectors.toList());
Where res is resultset i am getting from database, not sure what is wrong any idea?


whileloop completely?javaccompilation error or is it an error from your IDE? This should work.