Working with Arraylist
<p>I have an array list for ex</p>

<pre><code>Arraylist name = called an arraylist method();
</code></pre>

<p>the <code>Arraylist</code> method() returns the list which is stored in the <code>Arraylist</code> name</p>

<p>Now I want to assign the <code>Arraylist</code> which shows count 1.
This <code>Arraylist</code> returs two records ie {a, c}</p>

<p>I need to assign a to one vaiable and then c to another variable. How should I do it since I tried </p>

<pre><code>string x=name[0].tostring();
// here it shows this error
// "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

string y=name[1].tostring();
</code></pre>

<p>But the above code does not work</p>

<p>Please provide me with a solution</p>

<p>Thanks </p>
