Iterator interface 1. All the container classes that implement the Collection interface have an Iterator method to return an object that implements the Iterator interface. 2. the Iterator object is called an Iterator for convenient operations to traverse data in an object. The Iterator interface defines the following methods: boolen hasNext (); // determines whether there is an element object next () on the right of the cursor (); // return the element on the right of the cursor and move the cursor to the next position void remove (); // Delete the element on the left of the cursor [java] import java. util. arrayList; import java. util. iterator; import org. hibernate. session; import org. hibernate. sessionFactory; import org. hibernate. cfg. configuration; public class test1 {/*** Iterator interface ** 1. All the container classes that implement the Collection interface have an Iterator method to return an object that implements the Iterator interface ** 2. the Iterator object is called an Iterator for convenient operations to traverse data in the object ** 3. The Iterator interface defines the following methods: ** boolen hasNext (); // determines whether there is an element on the right of the cursor * object next (); // return the element on the right of the cursor and move the cursor to the next position * void remove (); // Delete the element on the left of the cursor */public static void main (String [] args) {// TODO Auto-generated method stub ArrayList s = new ArrayList (); s. add (1123); s. add (2344444); s. add ("sssss"); Iterator iterator = s. iterator (); while (iterator. hasNext () {System. out. println (iterator. next ());}}}