Question: ```
ArrayList<yellowPage> ob1 = new ArrayList<yellowPage>(); 
yellowPage thing = new yellowPage(100,100);
thing.calc(i,y,s3); 
ob1.add(thing);

```

I stored some data in `thing`. How can I retrieve the value stored in `ob1.thing`?

Answer: 
If you know the index, you can do yellowPage 

```
yellowPage yp = ob1.get(index);

```

Otherwise you need to iterate over the list.

```
Iterator<yellowPate> iter = ob1.iterator();
while(iter.hasNext())
{
    yellowPage yp = iter.next();
    yp.whateverYouwantGet();
}

```

Note: I just typed code here, there may be syntax errors.
Print the list and override toString method.

```
public String toString()
{
 return (""+ a+b);    //Here a and b are int fields declared in class
}

System.out.print(ob1);

```