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 had been around for donkeys years.
- Here is a canned example elsewhere.
- You could copy/paste code from here into this website to see,