Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; public class JavaDequeiteratorExample2 { public static void main(String[] args) { Deque
deque = new ArrayDeque<>(); System.out.println("The series of marks is given as : "); deque.add(34f); deque.add(25f); deque.add(66f); deque.add(39f); for(Iterator itr = deque.iterator(); itr.hasNext();) { System.out.println(itr.next()); } } }
Output