fork download
  1. import java.util.*;
  2. class Collection_iterators {
  3. public static void main(String args[]) {
  4. List<Integer> list = new ArrayList<Integer>();
  5. ListIterator a = list.listIterator();
  6. if(a.previousIndex()! = -1)
  7. while(a.hasNext())
  8. System.out.print(a.next() + " ");
  9. else
  10. System.out.print("EMPTY");
  11. }
  12. }
Compilation error #stdin compilation error #stdout 0.04s 4386816KB
stdin
Standard input is empty
compilation info
Main.java:6: error: ')' expected
if(a.previousIndex()! = -1)
                    ^
Main.java:6: error: illegal start of expression
if(a.previousIndex()! = -1)
                      ^
Main.java:6: error: ';' expected
if(a.previousIndex()! = -1)
                          ^
Main.java:9: error: 'else' without 'if'
else
^
4 errors
stdout
Standard output is empty