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: 
```
int x=5;
int info=ob1.get(x).getInfo();

```

The above example will get whatever information you wanted from your yellow pages class (by using a getter method) at the 6th index (because 0 counts) of your array list ob1. This example assumes you want an integer from the yellow page. You will have to create a getter method and change the x to the index of the yellow page you want to retrieve information from.

An example getter method (which you should put in your yellow pages class) could look like this:

```
public int getInfo() { return z; }

```

In the above case z may be an instance variable in your yellow pages class, containing the information you're looking for. You will most probably have to change this to suit your own situation.

If you wanted to get information from all yellow pages stored in the array list then you will need to iterate through it as Chrandra Sekhar suggested
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);

```