Project on Java Collections: Iterators

Iterators Project

Write a program to iterate through an ArrayList.

Hint: All of the collection classes provides iterator() method to iterate through the collection. The iterator() method returns the Iterator object through which you can access the collection elements in an order. Enumeration also does the same purpose. The difference between Iterator and Enumerations is: Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.

Copying Collections Project

Create a program and implement the following:

i.)   Write a program for copying LinkedList instance objects to an existing ArrayList.

ii.)  And also write code for copying all the contents of an ArrayList to an array.

Hint: ArrayList is a resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is unsynchronized.)

1 point
I have completed the project(s) for this lesson and have demonstrated them to my instructor.