Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; import java.util.ListIterator; public class JavaListIteratorremoveExample2 { public static void main(String[] args) { ArrayList < Float > marks = new ArrayList < Float > (); marks.add(55f); marks.add(69f); marks.add(78f); marks.add(89f); System.out.println("The list for the marks is given as :"+marks); ListIterator < Float > listIterator = marks.listIterator(); System.out.println("Before remove() method is called. : " + marks); listIterator.next(); listIterator.next(); listIterator.remove(); System.out.println("After remove() method is called.: " + marks); } }
Output