Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; public class JavaListIteratoraddExample3 { public static void main(String[] args) { List
li = new ArrayList<>(); Iterator
itr = null; li.add('t'); li.add('h'); li.add('j'); li.add('m'); itr = li.listIterator(); System.out.println("The list of alphabets is given as: "+li); } }
Output