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
Get step-by-step solutions from verified subject matter experts
