There are two things wrong here. First, you iterate forever because you don't call "next()" on that iterator; the way you typically use an iterator looks like
Now the other problem, about how all the values are the same, happens because you only ever create one array object. When you add something to a list, it's a reference to the object that is added, not a copy of the object itself. Therefore here you have one list with two references to the single array object. You need to use "new" to make a new array each time you want to add something to the list.
Thank you so much for pointing out the problems in the Java program that I posted. That little test program is now running without any problem.
What I am really trying to do is the Java class shown below. I am still struggling with it. Somehow, the data are eithere not properly added to the List (called the recursiveTextArray) or I still do not iterate the List correctly because when I iterate the List in the static void main(...) method, I see the first line of my data only in the console -  Animals.
No iteration further.
I am supposed to see:
 Animals [OO-3.1} Dog [TgtObj-3.1] Barks [OO-3.2] Cat [TgtObj-3.2] Hacks up furball
Here is the code:
Joined: May 06, 2003
I am able to better identify the place where the problem happens. But, I have no idea what is the proper Java code to address the problem.
I used the System.out.println to write out the "size" of the List - recursiveTextArray that I am trying to create. The "size' is always 1. Therefore, I am not adding the Array one at a time to the List.
How do I adde Array one at a time to a List?
Here is the simplified code:
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Adding Array to a List - Cannot Resoleve the Problem for a Week