Regarding arrayList
<p>I have used scanner instead of string tokenizer ,, below is the piece of code...</p>

<pre><code>Scanner scanner =  new Scanner("Home,1;Cell,2;Work,3");
scanner.useDelimiter(";");
while (scanner.hasNext()) {
    // System.out.println(scanner.next());
    String phoneDtls = scanner.next();

    // System.out.println(phoneDtls);
    ArrayList&lt;String&gt; phoneTypeList = new ArrayList&lt;String&gt;();
    if(phoneDtls.indexOf(',')!=-1) {

        String value = phoneDtls.substring(0, phoneDtls.indexOf(','));

        phoneTypeList.add(value);

    }

    Iterator itr=phoneTypeList.iterator();
    while(itr.hasNext())
        System.out.println(itr.next());
}
</code></pre>

<p>The ouput I get upon executing this...
Home
Cell
Work</p>

<p>As it is seen from the above code is that in the array list phoneTypeList we are finally storing the values..but the logic of finding out the value on the basisi of ',' is not that much great..that is ..</p>

<pre><code>if(phoneDtls.indexOf(',')!=-1) {
    String value = phoneDtls.substring(0, phoneDtls.indexOf(','));
    phoneTypeList.add(value);
}
</code></pre>

<p>could you please advise me with some other alternative ..!! to achieve the same thing...!!thanks a lot in advance..!!</p>
