Why does Java compiler give “error: cannot find symbol” for LinkedList descendingIterator in the following code?
问题 Why does this code: import java.util.*; class Playground { public static void main(String[ ] args) { List<Integer> l = new LinkedList<>(); Iterator<Integer> i = l.descendingIterator(); } } Generate this compiler error ./Playground/Playground.java:5: error: cannot find symbol Iterator<Integer> i = l.descendingIterator(); ^ symbol: method descendingIterator() location: variable l of type List<Integer> 1 error Here is the relevant JavaDocs API Running Java 7.. In case that is issue. Thought it