/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public class A5Q2 { public static void main( String[] args ) { StudentInfo.display(); // ------------------------------------------------------ // Test 1 // ------------------------------------------------------ LinkedList l; l = new LinkedList(); for ( int i=0; i<5; i++ ) { l.add( new Integer( i ) ); // adding elements to the list } System.out.println( "l = " + l ); Iterator j; j = l.iterator(); int count = 0; while ( j.hasNext() ) { j.next(); // moving the iterator at the end of the list count++; } for ( int i=0; i