Question: Write a Java application program in which main has an ArrayList of Integer and a LinkedList of Integer. Use a loop to add 10, 20,

Write a Java application program in which main has an ArrayList of Integer and a LinkedList of Integer. Use a loop to add 10, 20, 30, 40, and 50 to each of the lists. Use an iterator to display all the numbers in the ArrayList and another iterator to display all of the numbers in the LinkedList (separate loops). You MUST iterate either the ArrayList or LinkedList using an Iterator (calling hasNext() and next() methods), NOT an enhanced for loop!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!